1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Yet more refactoring of the tag macro vs template

This change re-instates the existing behaviour whereby omitting the
parameter to the “tag” macro will default to the current tiddler
This commit is contained in:
Jermolene 2016-12-16 17:25:03 +00:00
parent 7a71a87ed0
commit 28591965b1
2 changed files with 14 additions and 16 deletions

View File

@ -1,3 +1,15 @@
title: $:/core/ui/TagTemplate
<$macrocall $name="tag" tag=<<currentTiddler>>/>
<span class="tc-tag-list-item">
<$set name="transclusion" value=<<currentTiddler>>>
<$macrocall $name="tag-pill-body" tag=<<currentTiddler>> icon={{!!icon}} colour={{!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">>"""/>
<$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"/>
</$reveal>
</$set>
</span>

View File

@ -26,19 +26,5 @@ $actions$<$transclude tiddler="""$icon$"""/> <$view tiddler="""$tag$""" field="t
\end
\define tag(tag)
<span class="tc-tag-list-item">
<$set name="transclusion" value="""$tag$""">
<$macrocall $name="tag-pill-body" tag="""$tag$""" icon={{$tag$!!icon}} colour={{$tag$!!color}} palette={{$:/palette}} element-tag="""$button""" element-attributes="""popup=<<qualify "$:/state/popup/tag">>"""/>
<$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes" class="tc-drop-down">
<$tiddler tiddler="""$tag$""">
<$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"/>
</$tiddler>
</$reveal>
</$set>
</span>
{{$tag$||$:/core/ui/TagTemplate}}
\end