mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-04 19:12:51 +00:00
Refactor palette switcher a little
This commit is contained in:
parent
2e5a988bb3
commit
a5c4d90154
@ -7,9 +7,8 @@ title: $:/snippets/paletteswitcher
|
|||||||
<$action-setfield $tiddler="$:/palette" text=<<navigateTo>>/>
|
<$action-setfield $tiddler="$:/palette" text=<<navigateTo>>/>
|
||||||
\end actions
|
\end actions
|
||||||
|
|
||||||
<$linkcatcher actions=<<actions>>>
|
<!-- Display palette in currentTiddler with selection logic -->
|
||||||
<div class={{{ tc-chooser [<thumbnails>match[yes]then[tc-chooser-cards]] +[join[ ]] }}}>
|
\procedure palette-entry(thumbnails)
|
||||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]sort[name]]">
|
|
||||||
<div class={{{ [<currentTiddler>match{$:/palette}then[tc-chosen]] tc-chooser-item +[join[ ]] }}}>
|
<div class={{{ [<currentTiddler>match{$:/palette}then[tc-chosen]] tc-chooser-item +[join[ ]] }}}>
|
||||||
<$link to={{!!title}} aria-label=`${[[$:/language/ControlPanel/Palette/Caption]get[text]]}$ - ${[all[current]get[name]]}$. ${[all[current]get[description]]}$`>
|
<$link to={{!!title}} aria-label=`${[[$:/language/ControlPanel/Palette/Caption]get[text]]}$ - ${[all[current]get[name]]}$. ${[all[current]get[description]]}$`>
|
||||||
<%if [<thumbnails>match[yes]] %>
|
<%if [<thumbnails>match[yes]] %>
|
||||||
@ -20,6 +19,12 @@ title: $:/snippets/paletteswitcher
|
|||||||
<$view field="description" format="text"/>
|
<$view field="description" format="text"/>
|
||||||
</$link>
|
</$link>
|
||||||
</div>
|
</div>
|
||||||
|
\end palette-entry
|
||||||
|
|
||||||
|
<$linkcatcher actions=<<actions>>>
|
||||||
|
<div class={{{ tc-chooser [<thumbnails>match[yes]then[tc-chooser-cards]] +[join[ ]] }}}>
|
||||||
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]sort[name]]">
|
||||||
|
<$transclude $variable="palette-entry" thumbnails=<<thumbnails>>/>
|
||||||
</$list>
|
</$list>
|
||||||
</div>
|
</div>
|
||||||
</$linkcatcher>
|
</$linkcatcher>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user