1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-06 01:56:20 +00:00
TiddlyWiki5/core/ui/EditorToolbar/preview.tid
Simon Huber a3521eb67d
Use qualified-preview-state in default body-editor for reuse in preview button (#7795)
* Use qualified-preview-state to reuse in preview button

Somehow the editor-body template and the preview button don't qualify the same showeditpreview anymore

* Update preview.tid to use qualified-preview-state

* Update preview.tid

* Update default.tid

* Update preview.tid
2024-02-14 17:22:54 +01:00

17 lines
699 B
Plaintext

title: $:/core/ui/EditorToolbar/preview
tags: $:/tags/EditorToolbar
icon: $:/core/images/preview-open
custom-icon: yes
caption: {{$:/language/Buttons/Preview/Caption}}
description: {{$:/language/Buttons/Preview/Hint}}
condition: [<targetTiddler>]
button-classes: tc-text-editor-toolbar-item-start-group
shortcuts: ((preview))
\whitespace trim
<span>
<$transclude $tiddler={{{ [<edit-preview-state>match[yes]then[$:/core/images/preview-open]else[$:/core/images/preview-closed]] }}} />
</span>
<$action-setfield $tiddler=<<editPreviewStateTiddler>> $value={{{ [<editPreviewStateTiddler>get[text]toggle[yes],[no]] }}} />
<$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>