Hi Eric,
I'm definitely putting this into my notes. It seems like something that
will come up more than once.
I'm wondering if a longer term solution would be a change to the reveal
widget so that you can prevent it from creating it's own style attribute.
Then the resulting code could be a lot simpler. Maybe.
Thanks!
On Wednesday, July 22, 2020 at 12:46:59 PM UTC-7, Eric Shulman wrote:
>
> Here's another version that allows you to *completely bypass the
> type="popup" positioning and "cook your own"*
>
> <div style="position:absolute;right:0;z-index:2;">
> <$button popup=<<qualify "$:/state/popup/something">
> >>{{$:/core/images/options-button}}</$button>
> <$reveal state=<<qualify "$:/state/popup/something">> type="nomatch"
> text="" class="tc-popup-handle" style="position:relative;">
> <div class="tc-drop-down" style="position:absolute;right:0;min-width:
> fit-content;padding:0.5em;" >
> enter stuff here: <$edit-text tiddler="whatever" tag="input"
> default="" placeholder="" />
> </div>
> </$reveal>
> </div>
>
> 1) The outermost div controls the position of the $button/$reveal
> combination so it will appear in the margin and won't affect any other
> content
> 2) The $button uses popup="..." to toggle the popup state between
> blank/non-blank.
> 3) The $reveal uses class="tc-popup-handle" to 'eat' any clicks inside it
> without dismissing the popup
> 4) The $reveal also uses style="position:relative;" to establish a new
> (0,0) origin for it's contents
> 5) The div uses class="tc-drop-down" to get the box around the content and
> style="position:absolute;right:0;" to set the location of the tc-drop-down,
> relative to the origin established by the $reveal
> 7) The div also uses style="min-width:fit-content;padding:0.5em;" to
> adjust the appearance of the tc-drop-down
>
> I prefer the above approach over using "float" and "margin" styles, as it
> is more explicit in how things should be placed and will never affect
> anything else around it.
>
> -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/ca092e4d-f9f9-4ea2-b511-16016779990eo%40googlegroups.com.