Author/View Mode Resizing issue.
When I'm in author mode (Editing my spaces site) the gadget doesn't resize properly. When I switch to view mode then back to edit mode it works fine.. It also always works fine in view mode.
I'm starting to think it's a glitch in the framework, it's driving me nuts.
I didn't publish it live.. I registered it using the testing API's published on the spacecraft.
// register your Gadget's namespace
registerNamespace(
"abc.Live.Gadget");// define the constructor for your Gadget (this must match the name in the manifest XML)
abc.Live.Gadget.xyz =
function(p_elSource, p_args, p_namespace){
// always call initializeBase before anything else!abc.Live.Gadget.xyz.initializeBase(
this, arguments);var m_module = p_args.module;// Private method to outputthis.Output =function(){
if (p_args.module.getMode() == Web.Gadget.Mode.view ) {var url ="Some Url"}
else{
var url ="Some Other Url"}
// I put the same url in both locations and the issue still happens..
p_elSource.innerHTML =
"<iframe id=\"aaa\" src=\"" + url +"\" frameborder=\"0\" style=\"width: 97%; height: 600px; border: 0px;\" scrolling=\"auto\"></iframe>";m_module.resize(); // Tried with lower case "r" and upper "R" on resize .. I seen examples of both. SDK says lowercase.m_module.Resize();
}
abc.Live.Gadget.xyz.registerBaseMethod(
this,"Output");this.initialize =function(p_objScope){
// Call base class's initialize methodabc.Live.Gadget.xyz.getBaseMethod(
this,"initialize","Web.Bindings.Base").call(this, p_objScope);this.Output();}
abc.Live.Gadget.xyz.registerBaseMethod(
this,"initialize");this.dispose =function(p_blnUnload){
// Usually, you would add your dipose code here, but we have nothing to dispose for this Gadgetp_elSource =
null;// always call the base object's dispose last!abc.Live.Gadget.xyz.getBaseMethod(
this,"dispose","Web.Bindings.Base").call(this, p_blnUnload);}
abc.Live.Gadget.xyz.registerBaseMethod(
this,"dispose");}
abc.Live.Gadget.xyz.registerClass(
"abc.Live.Gadget.xyz","Web.Bindings.Base");
