On Thursday, December 19, 2019 at 11:48:41 AM UTC-8, Mohammad wrote:
>
> Summary:
>  How to drag and drop a tiddler from one droppable area to another 
> droppable area
>  where the action tiddler removed from list field of tiddler 1 and added 
> to list field of tiddler 2
>

I just recently wrote something similar for the custom TOC macro I use in 
InsideTiddlyWiki.

Here's a link to my code:
http://tiddlytools.com/InsideTW/#TiddlyTools%2FTOC%2FMacros

and here's an excerpt showing the relevant handling:
\define toc-item-drop()
<!-- get OLDTAG and NEWTAG, exclude special tags -->
<$vars sourcetags={{{ [<actionTiddler>get[tags]] }}}
       targettags={{{ [<item>get[tags]] }}}>
<$vars oldtag={{{ [enlist<sourcetags>!enlist<toc-ignore-tags>] }}}
       newtag={{{ [enlist<targettags>!enlist<toc-ignore-tags>] }}}>
<$reveal default=<<modifier>> type="match" text="normal"> <!-- DROP AS 
SIBLING -->
   <$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter=
"-[<oldtag>]" />
   <$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter=
"[<newtag>]" />
   <$action-listops $tiddler=<<oldtag>>        $field="list" $subfilter=
"-[<actionTiddler>]" />
   <$action-listops $tiddler=<<newtag>>        $field="list" $subfilter=
"+[insertbefore:item<actionTiddler>]" />
</$reveal>
<$reveal default=<<modifier>> type="match" text="shift"> <!-- DROP AS CHILD 
-->
   <$action-listops $tiddler=<<actionTiddler>> $field="tags" 
$subfilter="-[<oldtag>]" />
   <$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter=
"[<item>]" />
   <$action-listops $tiddler=<<oldtag>>        $field="list" $subfilter=
"-[<actionTiddler>]" />
   <$action-listops $tiddler=<<item>>          $field="list" $subfilter=
"[<actionTiddler>]" />
</$reveal>
</$vars>
</$vars>
\end

Note that I am manipulating both "tags" and "list" fields (the TOC uses 
entries in the "tags" field to define a tiddler (the "actionTiddler") as a 
"child" of a specific "branch" (the "item") of the tree, and the branch 
itself uses the "list" field to set the order of display for it's 
"children").  Also notice that I have different handling for "shift-drop" 
vs. regular "drop".  

While this isn't exactly what you are trying to do, perhaps it will give 
you some clues that help you find the right direction...

enjoy,
-e

-- 
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/7f38d053-5fbe-46a3-9806-e5f6e75f894a%40googlegroups.com.

Reply via email to