From: Robert R. <rra...@ya...> - 2001-01-06 21:45:36
|
I updated CVS with the setHTML noevt. I also fixed the setURL in the loadpanel, only I use this.url = url instead of .tempURL=url. From what I saw, the this.url is the one that is called on the create event (ie o.setURL(o.url)). -- // Robert Rainwater On 1/6/2001, 8:52:57 AM EST, Cameron wrote about "[Dynapi-Dev] loadpanel fix, dynapi suggestion.": > 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/ > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-dev |