From: <cam...@ya...> - 2001-01-06 13:52:49
|
This is a small fix for loadpanel. The problem occured if you did the following: lp = new LoadPanel(); lp.setURL('html.html'); DynAPI.document.addChild(lp); setURL doesn't check if the LoadPanel has been created yet. This is my suggested fix: LoadPanel.prototype.setURL = function(url) { if (!url) return; if (!this.created) { this.tempURL=url; } else { LoadPanel.queue.add(url,this); } }; Also, I'd like to suggest adding a no event parameter to setHTML: DynLayer.prototype.setHTML=function(html,noevt) { this.html=html?html:''; if (this.css==null) return; if (noevt!=false) this.invokeEvent("beforeload"); this.elm.innerHTML=html; if (is.ns4) { this.doc.open(); this.doc.write(html); this.doc.close(); for (var i in this.doc.images) this.doc.images[i].lyrobj=this; } else if (is.ns5) { while (this.elm.hasChildNodes()) this.elm.removeChild(this.elm.firstChild); var r=this.elm.ownerDocument.createRange(); r.selectNodeContents(this.elm); r.collapse(true); var df=r.createContextualFragment(html); this.elm.appendChild(df); for (var i in this.doc.images) this.doc.images[i].lyrobj=this.elm; } else { for (var i in this.elm.all.tags("img")) { this.elm.all.tags("img")[i].lyrobj=this; } } if (noevt!=false) this.invokeEvent("load"); }; I'd greatly appreciate if these updates made it into the CVS! Cheers, Cameron. __________________________________________________ Do You Yahoo!? Yahoo! Photos - Share your holiday photos online! http://photos.yahoo.com/ |