[TW5] slider / reveal widget reset only on opening tiddler?

77 views
Skip to first unread message

Dave

unread,
Apr 3, 2016, 9:12:45 PM4/3/16
to TiddlyWiki
Consider this reveal widget:

\define sb(c)

<$reveal  type="nomatch" text="" default="" state="$:/state/myslider$c$" text="show">
<$button set="$:/state/myslider$c$" setTo="show">.</$button>
</$reveal>
<$reveal type="match" state="$:/
state/myslider$c$" default=""  text="show">
<$button set="
$:/state/myslider$c$" setTo="hide">-</$button>

$c$

</$reveal>
\end

The state of the tiddler is kept in "$:/state/myslider$c$" and if you open other sliders with different content in the same tiddler it will stay open, unaffected by other <<sb "something else">> instances

That's the behaviour I'm looking for, but if you close that tiddler and reopen it, they will be in the same state that you left them.


What I'd like to happen is for them to stay open (unless clicked closed) while the tiddler is showing, but reset to closed the next time you open that tiddler.

* Is there a transient variable or tiddler that only exists while the tiddler is open (like a /tmp/file in linux that disappears on reboot) but then goes away when closed that I can assign the reveal widget state to so I can get this behaviour?
* Otherwise is there a way to trigger the state to clear once the tiddler is closed?


Thanks,
Dave

Hegart Dmishiv

unread,
Apr 3, 2016, 9:21:42 PM4/3/16
to TiddlyWiki
Hi Dave,

This sounds like an issue of TW state persistence, which was discussed a while ago and a solution suggested here.

Hope this helps,

Hegart.

Dave

unread,
Apr 4, 2016, 1:28:14 AM4/4/16
to tiddl...@googlegroups.com
Thanks Hegart, maybe I can use that to make a button that "resets" all the reveal widgets from the menu or something.  That would work.  :)

Reply all
Reply to author
Forward
0 new messages