Fix palette switcher used in the sidebar

by adding a new "thumbnails" parameter to the template
This commit is contained in:
Jeremy Ruston
2025-01-09 14:51:48 +00:00
parent 55d9e92032
commit c75f50e99a
4 changed files with 24 additions and 22 deletions
+9 -10
View File
@@ -1,26 +1,25 @@
title: $:/snippets/paletteswitcher
\parameters (thumbnails)
\whitespace trim
\procedure actions()
<$transclude $variable="actions-switch-colour-palette" paletteTitle=<<navigateTo>>/>
\end actions
<$linkcatcher actions=<<actions>>>
<div class="tc-chooser tc-chooser-cards">
<div class={{{ tc-chooser [<thumbnails>match[yes]then[tc-chooser-cards]] +[join[ ]] }}}>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Palette]sort[name]]">
<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]]}$`>
{{||$:/snippets/currpalettepreview}}
<div class="tc-chooser-item-description">
''<$view field="name" format="text"/>''
<div class="tc-chooser-item-subtitle">
<$view field="description" format="text"/>
</div>
</div>
<%if [<thumbnails>match[yes]] %>
{{||$:/snippets/currpalettepreview}}
<%endif%>
''<$view field="name" format="text"/>''
<br>
<$view field="description" format="text"/>
</$link>
</div>
</$list>
</div>
</$linkcatcher>
{{$:/snippets/palettetests}}