views:

881

answers:

1

I have a very strange bug going on. I cannot get the flyout to show on my gadget, despite having reproduced the flyout code character for character from a gadget that has a flyout that works fine.

Here's the code:

function doFly(i){

var div = 'div_' + i;
flyHTML = $(div).html();

if (System.Gadget.Flyout.show == false){

System.Gadget.Flyout.file = "flyout.html";
System.Gadget.Flyout.show = true;
msgJS(System.Gadget.Flyout.show);
}

else{
System.Gadget.Flyout.show = false;
}


}

The msgJS function provides an ActiveX popup for debugging purposes. Even though I've set .show to true in the previous line, the value is still false when I call the popup. I cannot get the flyout to show, period. At first I thought I was losing click events, but if I stay in the main gadget DOM, the clicks are registering and the remainder of the code executes correctly.

What is going on that .show wouldn't be setting at all? I've checked the known bugs, and none of them seem to apply to this. It's maddening.

A: 

Update: Here's the code I'm using now:

function doFly(i){

var div = 'div_' + i;
flyHTML = $(div).html();

if (System.Gadget.Flyout.show == false){

 try {
  System.Gadget.Flyout.file = "flyout.html";
  System.Gadget.Flyout.show = true;
  $('a#teamr').text(System.Gadget.Flyout.show);
 }
 catch(e){
  $('a#teamr').text(e);
 }
}

else{
 System.Gadget.Flyout.show = false;
}

Which shows that the code isn't throwing an exception, and the value of the .show is false. There's a bug associated with the Sidebar where the gadget will lose focus, and that closes the flyout. I can only imagine that I'm going to have to work around it. The question I have is: what's causing the loss of focus? Bizarre.

b. e. hollenbeck