1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Refactor $:/core/ui/TagTemplate using sub-tiddlers (#2477)

The Open All by tag feature should really be in a plugin.
This commit is contained in:
Andrew J Harrison 2016-06-14 08:46:40 -07:00 committed by Jeremy Ruston
parent a9c4f113a1
commit f76c7e9560

View File

@ -7,18 +7,18 @@ color:$(foregroundColor)$;
\end
\define tag-body-inner(colour,fallbackTarget,colourA,colourB)
<$set name="foregroundColor" value=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">>>
<$set name="backgroundColor" value="""$colour$""">
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<$button popup=<<qualify "$:/state/popup/tag">> class="tc-btn-invisible tc-tag-label" style=<<tag-styles>>>
<$transclude tiddler={{!!icon}}/> <$view field="title" format="text" />
</$button>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes"><div class="tc-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem">
<$transclude tiddler=<<listItem>>/>
</$list>
<hr>
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
</div>
</$reveal>
</$set>
</$set>
</$vars>
\end
\define tag-body(colour,palette)
@ -27,4 +27,4 @@ color:$(foregroundColor)$;
</span>
\end
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/>
<$macrocall $name="tag-body" colour={{!!color}} palette={{$:/palette}}/>