>
> One more question:
>
> I confused with drag and drop when there are more than a tag! (I mean an
> entry in the TOC tree has more than one tags)
>
> Example:
>
> * *root*
> ** *child1*
> *** gchild1
> *** gchild2
> ** *child2*
> ** *child3*
>
>
> they have a hierarchy and create a tree.
> Now assume *gchild2 *not only tagged with *child1 *but also tagged with foo
> and bar!
> Then I tried to drag and drop *gchild2 *over *child3 *(no modifier) I see
> *gchild2
> *remains under *child1 *branch and also appears before *child3 *(gets the
> *root
> *tag as expected)
>
> Is there any limitation here, or I made a mistake?
>
> --Mohammad
>
>
I think the below may acts as an alternative when both source tiddler and
target tiddler have multiple tags and one reorder tiddlers by drag and drop
\define toc-item-dragdata() $:/temp/TOC/dragdata
\define toc-item-dragdata-path() $:/temp/TOC/dragdata/path
\define toc-item-dragstart()
<$action-setfield $tiddler=<<toc-item-dragdata>> text=<<actionTiddler>> />
<$action-setfield $tiddler=<<toc-item-dragdata-path>> text=<<path>> />
\end
\define toc-item-dragend()
<$action-deletetiddler $tiddler=<<toc-item-dragdata>> />
<$action-deletetiddler $tiddler=<<toc-item-dragdata-path>> />
\end
\define toc-item-drop()
<$reveal default=<<actionTiddler>> type="nomatch" text=<<item>>> <!-- DON'T
DROP ON SELF -->
<!-- get OLDTAG and NEWTAG, exclude special TiddlyBook tags -->
<$vars sourcepath={{{ [<toc-item-dragdata-path>get[text]] }}}
targetpath=<<path>> >
<$vars oldtag= {{{ [<sourcepath>split[/]]-[<actionTiddler>]+[last[]] }}}
newtag={{{ [<targetpath>split[/]]-[<item>]+[last[]] }}}>
<$reveal default=<<modifier>> type="match" text="normal"> <!-- DROP BEFORE
SIBLING -->
<$set name="order" filter="[<newtag>tagging[]]">
<$list filter=<<order>>> <$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/> </$list>
<$action-listops $tiddler=<<actionTiddler>> $field="tags"
$subfilter="-[<oldtag>] [<newtag>]" />
<$action-listops $tiddler=<<oldtag>> $field="list"
$subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<newtag>> $field="list"
$subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>]
+[putbefore<item>]" />
</$set>
</$reveal>
<$reveal default=<<modifier>> type="match" text="shift"> <!-- DROP AFTER
SIBLING -->
<$set name="order" filter="[<newtag>tagging[]]">
<$list filter=<<order>>> <$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/> </$list>
<$action-listops $tiddler=<<actionTiddler>> $field="tags"
$subfilter="-[<oldtag>] [<newtag>]" />
<$action-listops $tiddler=<<oldtag>> $field="list"
$subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<newtag>> $field="list"
$subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>]
+[putafter<item>]" />
</$set>
</$reveal>
<$reveal default=<<modifier>> type="match" text="ctrl"> <!-- DROP AS CHILD
-->
<$set name="order" filter="[<item>tagging[]]">
<$list filter=<<order>>> <$action-deletefield $field="list-before"/>
<$action-deletefield $field="list-after"/> </$list>
<$action-listops $tiddler=<<actionTiddler>> $field="tags"
$subfilter="-[<oldtag>] [<item>]" />
<$action-listops $tiddler=<<oldtag>> $field="list"
$subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<item>> $field="list"
$subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>]" />
</$set>
</$reveal>
</$vars>
</$vars>
</$reveal>
\end
Please have a look and let me know your opinion on this?
--Mohammad
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/c2b27433-eebe-4f11-81c0-678baf368ba7%40googlegroups.com.