kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Refactor new journal actions
Using contained actions, as we were, meant that the actions (and in this case the wikify widget) were being rendered at render time, but might have been out of date by the time the actions were triggered. Using the action attribute ensures the actions are rendered when they are executed. Fixes #3326single-tiddler-mode
rodzic
17e73befde
commit
29606c6d24
|
@ -3,8 +3,7 @@ tags: $:/tags/PageControls
|
|||
caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/Caption}}
|
||||
description: {{$:/language/Buttons/NewJournal/Hint}}
|
||||
|
||||
\define journalButton()
|
||||
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>>>
|
||||
\define journalActions()
|
||||
<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>""">
|
||||
<$reveal type="nomatch" state=<<journalTitle>> text="">
|
||||
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text={{{ [<journalTitle>get[]] }}}/>
|
||||
|
@ -12,13 +11,17 @@ description: {{$:/language/Buttons/NewJournal/Hint}}
|
|||
<$reveal type="match" state=<<journalTitle>> text="">
|
||||
<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalTags>> text=<<journalText>>/>
|
||||
</$reveal>
|
||||
</$wikify>
|
||||
\end
|
||||
|
||||
\define journalButton()
|
||||
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>> actions=<<journalActions>>>
|
||||
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
|
||||
{{$:/core/images/new-journal-button}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$:/language/Buttons/NewJournal/Caption}}/></span>
|
||||
</$list>
|
||||
</$wikify>
|
||||
</$button>
|
||||
\end
|
||||
<$set name="journalTitleTemplate" value={{$:/config/NewJournal/Title}}>
|
||||
|
|
Ładowanie…
Reference in New Issue