I want to create a tag based menu kind of widget with a dual mode; one
that acts like a checkbox form (multiple selections possible) and one
that acts like a radio button form (only one selection possible). When
a tag is clicked, it should toggle its color and a script should
process the new state of the entire menu (based on all the current
selections). Here's the base setup:
http://84.81.3.149/labs/ac/src/tm.html
Now I've the following questions:
[1] It seems that clicks are generated/triggered twice. Any clue?
[2] What's an easy way to toggle a tag's color (select/unselect)?
[3] What's an easy way to capture the entire menu (e.g. the state of
each individual tag after a click)?
Here's part of the main code:
<app:iterator items="['option1','option2','option3']">
<span class="togglemenu" on="
mouseover then set[background-color='#545454']
or
mouseout then set[background-color='#191919']
or
togglemenu[select] then set[color='#990000']
or
togglemenu[unselect] then set[color='#bbb'] or
click then l:pickone
">
#{iterator_value}
</span>
</app:iterator>
<app:statemachine id="togglemenu" initial="select">
<state name="select" if="l:do.togglemenu.all"></state>
<state name="unselect" if="l:do.togglemenu.none"></
state>
</app:statemachine>