On Thursday, September 9, 2021 at 2:56:13 AM UTC-7 Petri M. wrote:
> I can't figure this one out. So, I have a sidebar search tiddler where I
> want to show three different kinds of searches at the same time but I want
> each of them to be collapsable for easy navigation. I got everything else
> working fine but I cannot figure out how to get them to collapse and expand
> independently.
>
Popups are intended to* appear only when the corresponding state tiddler
has a value* and the TWCore system *automatically dismisses popups when it
detects a click elsewhere.*
However, your goal is to have an "anti-popup" that has the inverse
behavior... i.e., it defaults to being visible unless the state tiddler
value is set by a button click, and then remains that way until the button
is clicked again. The solution is to *not use popups at all.* Instead,
you want the button to simply toggle the state tiddler between blank and
non-blank and then use that value to determine when to show the associated
content.
Here's one way to write this using set/setTo and a "filtered transclusion"
to calculate the desired state value:
<$button class="sidebar-collapsible"
selectedClass="sidebar-collapsible-onclick"
set="test1" setTo={{{ [{test1}match[hide]then[show]else[hide]] }}}>Title
matches:</$button>
<$reveal state="test1" type="nomatch" text="hide"> ... t1 </$reveal>
<$button class="sidebar-collapsible"
selectedClass="sidebar-collapsible-onclick"
set="test2" setTo={{{ [{test2}match[hide]then[show]else[hide]] }}}>Title
matches:</$button>
<$reveal state="test2" type="nomatch" text="hide"> ... t2 </$reveal>
Note: The current value of the state tiddlers will be retained when you
save your file. However, if you want the state tiddlers to be reset when
you save the file, *name them starting with "$:/state/popup/"*. By
default, tiddlers with that prefix are not retained when the file is saved.
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/7b4f5780-7e23-4c06-b0c0-2c9eec08dbf6n%40googlegroups.com.