Hello,
I've ended up with a ridiculous nest of ifnot statements and am curious if there might be a cleaner solution.
Here's the relevant bit of xml:
<plugin name="dock"
[...]
onloaded="delayedcall(5,ifnot(hovering,action(hideDock)));"
onover="action(showDock);"
onhover=""
onout="delayedcall(1,ifnot(hovering,ifnot(plugin[Button1].hovering,ifnot(plugin[Button2].hovering,ifnot(plugin[Button3].hovering,action(hideDock))))));"
ondown=""
The dock plugin delimits an area containing buttons/controls. The behavior is simple: briefly show the area/buttons when loaded and then hide if the cursor is elsewhere. Show on mouse over. When mouse out wait briefly to account for mousing errors around edges before hiding.
The onout statement is getting very messy because of the delayedcall and the necessity of using infnots for each button. I was curious if there isn't a better, more human-readable way than what I have above?
I have more buttons than just the three in this snippet.
When I omit the ifnot statements for each button and move the cursor over the button, the hideDock action fires, but because each button contains onover="action(showDock);" the dock comes back again, which causes everything to oscilate in and out.
It would be much easier were it possible to just check if the cursor was not over any object.
Any nudges towards clarity would be appreciated.
I've also noticed an inconsistency in the way my hideDock action behaves. From onloaded, one of the buttons does not move offscreen and just fades away, but from onout it moves offscreen as it should. There's nothing in the xml that I can find to account for the difference.
Thanks
Joe