1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-12 12:59:57 +00:00

Fix list-tagged-draggable for quotes !! and ## (#3442)

* fix list-tagged-draggable for quotes !! and ##

* Update list.tid

* Update list.tid

* Update list.tid
This commit is contained in:
BurningTreeC 2018-11-20 12:43:15 +01:00 committed by Jeremy Ruston
parent b009a60b69
commit 430be4ec30

View File

@ -50,28 +50,33 @@ tags: $:/tags/Macro
</$vars> </$vars>
\end \end
\define list-tagged-draggable-drop-actions() \define list-tagged-draggable-drop-actions(tag)
<!-- Save the current ordering of the tiddlers with this tag --> <!-- Save the current ordering of the tiddlers with this tag -->
<$set name="order" filter="[<tag>tagging[]]"> <$set name="order" filter="[<__tag__>tagging[]]">
<!-- Remove any list-after or list-before fields from the tiddlers with this tag --> <!-- Remove any list-after or list-before fields from the tiddlers with this tag -->
<$list filter="[<tag>tagging[]]"> <$list filter="[<__tag__>tagging[]]">
<$action-deletefield $field="list-before"/> <$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/> <$action-deletefield $field="list-after"/>
</$list> </$list>
<!-- Assign the list field of the tag with the current ordering --> <!-- Save the new order to the Tag Tiddler -->
<$action-setfield $tiddler=<<tag>> $field="list" $value=<<order>>/> <$action-listops $tiddler=<<__tag__>> $field="list" $filter="+[enlist<order>] +[insertbefore:currentTiddler<actionTiddler>]"/>
<!-- Add the newly inserted item to the list -->
<$action-listops $tiddler=<<tag>> $field="list" $subfilter="+[insertbefore:currentTiddler<actionTiddler>]"/>
<!-- Make sure the newly added item has the right tag --> <!-- Make sure the newly added item has the right tag -->
<$action-listops $tiddler=<<actionTiddler>> $tags="[<tag>]"/> <!-- Removing this line makes dragging tags within the dropdown work as intended -->
<!--<$action-listops $tiddler=<<actionTiddler>> $tags=<<__tag__>>/>-->
<!-- Using the following 5 lines as replacement makes dragging titles from outside into the dropdown apply the tag -->
<$list filter="[<actionTiddler>!contains:tags<__tag__>]">
<$fieldmangler tiddler=<<actionTiddler>>>
<$action-sendmessage $message="tm-add-tag" $param=<<__tag__>>/>
</$fieldmangler>
</$list>
</$set> </$set>
\end \end
\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div") \define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div")
<$set name="tag" value="""$tag$"""> <$set name="tag" value=<<__tag__>>>
<$list filter="[<tag>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>>> <$list filter="[<__tag__>tagging[]$subFilter$]" emptyMessage=<<__emptyMessage__>>>
<$elementTag$ class="tc-menu-list-item"> <$elementTag$ class="tc-menu-list-item">
<$droppable actions=<<list-tagged-draggable-drop-actions>>> <$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""">
<$elementTag$ class="tc-droppable-placeholder"> <$elementTag$ class="tc-droppable-placeholder">
&nbsp; &nbsp;
</$elementTag$> </$elementTag$>
@ -86,7 +91,7 @@ tags: $:/tags/Macro
</$elementTag$> </$elementTag$>
</$list> </$list>
<$tiddler tiddler=""> <$tiddler tiddler="">
<$droppable actions=<<list-tagged-draggable-drop-actions>>> <$droppable actions="""<$macrocall $name="list-tagged-draggable-drop-actions" tag=<<__tag__>>/>""">
<$elementTag$ class="tc-droppable-placeholder"> <$elementTag$ class="tc-droppable-placeholder">
&nbsp; &nbsp;
</$elementTag$> </$elementTag$>