JimNastiq

Hi there,

my gadget is a simple button and with a click it shows the flyout and with another click on the button it hides the flyout. so i made something like this:


Code Snippet

<div id="updateRadio" border="none" style="position:left;"
onclick="if (System.Gadget.Flyout.show == true){
System.Gadget.Flyout.show = false;
}
else System.Gadget.Flyout.show = true;">
<g:image src="button.png"/>
</div>


the problem is that when i click it shows the flyout normally but to close it i need to click 2 times on the button. it seems that after one click the gadget take the focus and with the second click it runs normally. am i right and what can i do to solve my problem

thx


Re: Sidebar Gadget Development Problem with a flyout using click to show/hide it

Jonathan Abbott

Your Gadget has lost focus. Have a look at bug#12, which also includes a workaround - see if it fixes the problem.

You can shorten your flyout toggle:

Code Snippet

System.Gadget.Flyout.show = !System.Gadget.Flyout.show;






Re: Sidebar Gadget Development Problem with a flyout using click to show/hide it

JimNastiq

Ok great, it works fine! thank you for your useful help Wink