Hallo, I’m trying to close a modal from a custom button inside the modal content, not with the built-in close button.
My use case is: a button inside the modal named “save&close“ run several actions first, then close the currently open modal at the end.
For example, I want the button “save&close” to do that:
creates a tiddler, updates some fields or tags, clears temporary tiddlers, and finally closes the modal.
So my actual question is: Is there a supported way to close the currently open modal from a custom button inside the modal content (after running multiple actions)?
<$let modal="$:/temp/myModal">
<$button message=tm-modal param=<<modal>>>
open modal
<$action-setfield $tiddler=<<modal>>
subtitle="modal title"
text="""
modal content goes here
<$button message=tm-close-tiddler actions="... save actions go here...">
save and close
</$button>
""">
</$button>
Perfect — my apologies, I didn’t see it in the documentation. On the other hand, even now that I’ve read it, I still wouldn’t have associated it with modals either.
Best regards, and have a restful weekend! And thanks again.