I have a windows gadget that dies when I close a flyout using the following code:
function CheckDockState() {
System.Gadget.beginTransition();
var oBody = document.body.style;
if (System.Gadget.docked) {
oBody.height = 80;
} else {
oBody.height = 800;
}
System.Gadget.endTransition(System.Gadget.TransitionType.morph, timeTransition);
}
function flyoutClose() {
CheckDockState();
System.Gadget.Flyout.show = false;
}
Now, this works fine but when I close the flyout - I cannot resize the gadget (using the little "larger version" button)...
Has anyone else had this problem?
Cheers.
Well, I beat you all to it..
Turns out that the System.Gadget declarations need to be in the loaded() function.
e.g.
function loaded() {
System.Gadget.onDock = CheckDockState;
System.Gadget.onUndock = CheckDockState;
System.Gadget.settingsUI = "settings.html";
System.Gadget.onSettingsClosed = SettingsClosed;
System.Gadget.Flyout.file = "flyout.html";
CheckDockState();
}
Before, I had them just at the top of the file.