On Thursday, July 2, 2020 at 11:24:04 AM UTC-7, Eric Shulman wrote:
>>
>> I'm also working on an enhanced version where the buttons appear as a
>> "popup"
>> only when the $edit-text control gets the input focus, but I'm still
>> debugging that
>> version (there's a strange interaction between the focus and the popup
>> that I
>> haven't yet figured out).
>>
>
> Here's the version that uses the focusPopup="..." method, so that the
> delete/cancel/ok buttons
> only appear when you put the cursor into the input field:
>
> \define inputpopup(fieldname)
> <$vars
> temp="$:/temp/$(currentTiddler)$/$fieldname$"
> popup=<<qualify "$:/state/popup/$(currentTiddler)$/$fieldname$">>
> default={{{ [<currentTiddler>get[$fieldname$]] }}}
> placeholder="enter a value for $fieldname$">
> <$keyboard key="enter" actions="""
> <$action-setfield $tiddler=<<currentTiddler>> $field="$fieldname$"
> $value={{{ [<temp>get[text]] }}} />
> <$action-deletetiddler $filter="[<popup>] [<temp>]" />
> """>
> <$edit-text tag="input" tiddler=<<temp>> default=<<default>> placeholder
> =<<placeholder>> focusPopup=<<popup>> class="tc-popup-handle"/>
> </$keyboard>
> <$reveal state=<<popup>> type="popup" text="" position="right"
> style="margin-left:0.25em;">
> <$button tooltip="delete field"> {{$:/core/images/delete-button}}
> <$action-deletefield $tiddler=<<currentTiddler>> $field=
> "$fieldname$"/>
> <$action-deletetiddler $filter="[<popup>] [<temp>]" />
> </$button>
> <$button tooltip="cancel input"> {{$:/core/images/cancel-button}}
> <$action-deletetiddler $filter="[<popup>] [<temp>]" />
> </$button>
> <$button tooltip="save input"> {{$:/core/images/done-button}}
> <$action-setfield $tiddler=<<currentTiddler>> $field="$fieldname$"
> $value={{{ [<temp>get[text]] }}} />
> <$action-deletetiddler $filter="[<popup>] [<temp>]" />
> </$button>
> </$reveal>
> </$vars>
> \end
>
> Install it the same way as the previous version:
> * copy the above code into a tiddler (e.g.,
> "/TiddlyTools/Macros/inputpopup")
> * tag that tiddler with "$:/tags/Macro"
> * in any other tiddler, write:
> <<inputpopup "foo">>
>
>
Trash bin icon is absent for me. Plus sometimes icons appear in some weird
places. :) And there is a problem with overlapping if there is a text or
another field after the inputpopup-field.
PS. Actually I don't have problems with the icons showing all the time -
they are kinda cute. :)
--
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/1effafc2-5dd2-43ec-932b-9371d1569c21o%40googlegroups.com.