On Wednesday, July 28, 2021 at 5:27:25 PM UTC-7 TW Tones wrote:
> Have you ever made a popup also a dropzone?
> I would like a popup that has a number of coloured boxes that represent
> fields I can drop content into. eg a link
>
It's actually quite straightforward. Try this:
\define dropActions()
<$action-createtiddler $basetitle=<<actionTiddler>>
tags={{{ [<actionTiddler>get[tags]] }}}
text={{{ [<actionTiddler>get[text]] }}}/>
\end
<$button popup=<<qualify "$:/state/popup/myPopup">>> CLICK ME! </$button>
<$reveal state=<<qualify "$:/state/popup/myPopup">> type="popup"
position="belowright">
<div class="tc-drop-down" style="transform:translate(0,calc(-50% -
1em));">
<$droppable tag="div" actions=<<dropActions>>>
POPUP CONTENT HERE
<p/>
SOME MORE CONTENT
<p/>
ETC.
</$droppable>
</div>
</$reveal
Notes:
* The $droppable widget uses tag="div" so that the entire background of the
popup is the drop target
* For this example, dropActions() creates a new tiddler with "TiddlerTitle
(n)" that copies the tags and text fields.
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/4c66e8a2-43ce-4e31-bcd6-b167807c52d2n%40googlegroups.com.