Consider this small macro using stateTitle and stateIndex for reveal widget!

\define toggle-button(stateTiddler:"$:/state/toggle", stateIndex:"status", 
class:"")
<$reveal type="nomatch" stateTitle=<<__stateTiddler__>> 
stateIndex=<<__stateIndex__>> text="open">
<$button setTitle=<<__stateTiddler__>> setIndex=<<__stateIndex__>> setTo="open" 
class="$class$">
Open</$button>
</$reveal>

<$reveal type="match" stateTitle=<<__stateTiddler__>> 
stateIndex=<<__stateIndex__>> text="open">
<$button setTitle=<<__stateTiddler__>> setIndex=<<__stateIndex__>> 
setTo="closed" class="$class$">
Closed</$button>
</$reveal>
\end


No try the below example

<<toggle-button stateTiddler:"myTid" stateIndex:"xx">>

While you are in preview mode, try to change the *stateIndex *from "xx" to 
something else like "xx2"

*The JS redwindow will be appeared!*

If you donot use stateIndex and stateTitle and go through traditional state 
attribute, everything works fine!

--Mohammad

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5c1e6b6d-d597-4e4e-bf9c-6d2f5d05db93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to