\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