mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-29 21:09:56 +00:00
327ecf8f66
* Don't refresh the body editor when switching the preview on and off * Focus editor when switching the preview on or off
26 lines
1.0 KiB
Plaintext
26 lines
1.0 KiB
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
|
|
<$let
|
|
edit-preview-state={{{ [{$:/config/ShowEditPreview/PerTiddler}!match[yes]then[$:/state/showeditpreview]] :else[<qualify "$:/state/showeditpreview">] }}}
|
|
>
|
|
<$reveal state=<<edit-preview-state>> type="match" text="yes" tag="span">
|
|
{{$:/core/images/preview-open}}
|
|
<$action-setfield $tiddler=<<edit-preview-state>> $value="no"/>
|
|
<$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>
|
|
</$reveal>
|
|
<$reveal state=<<edit-preview-state>> type="nomatch" text="yes" tag="span">
|
|
{{$:/core/images/preview-closed}}
|
|
<$action-setfield $tiddler=<<edit-preview-state>> $value="yes"/>
|
|
<$action-sendmessage $message="tm-edit-text-operation" $param="focus-editor"/>
|
|
</$reveal>
|
|
</$let>
|