Update of /cvsroot/dynapi/dynapi/src/lib/dynapi/api
In directory usw-pr-cvs1:/tmp/cvs-serv2533

Modified Files:
        dynlayer.js 
Log Message:
- Removed check for ns4 in specificCreate when setting ns4's visibility
- innerHTML is now only set for IE
- setSize should only return if there is no change

Index: dynlayer.js
===================================================================
RCS file: /cvsroot/dynapi/dynapi/src/lib/dynapi/api/dynlayer.js,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -r1.58 -r1.59
*** dynlayer.js 2001/06/16 01:50:43     1.58
--- dynlayer.js 2001/06/16 04:01:12     1.59
***************
*** 9,16 ****
        this.DynObject();
  
-       this.elm=null;
-       this.doc=null;
-       this.css=null;
- 
        var a=arguments;
        if(a[0]) this.setID(a[0]);
--- 9,12 ----
***************
*** 24,27 ****
--- 20,27 ----
        this.bgImage=a[8]||null;
        this.html=null;
+ 
+       this.elm=null;
+       this.doc=null;
+       this.css=null;
  };
  DynLayer.prototype = new DynObject();
***************
*** 31,36 ****
        if (is.ns6) {
                var 
parentElement=(this.parent.isDynLayer)?this.parent.elm:this.parent.doc.body;
!               this.doc=this.parent.doc;
!               var r = parentElement.ownerDocument.createRange()
                r.setStartBefore(parentElement);
                ptxt = r.createContextualFragment(this.getOuterHTML());
--- 31,35 ----
        if (is.ns6) {
                var 
parentElement=(this.parent.isDynLayer)?this.parent.elm:this.parent.doc.body;
!               var r = parentElement.ownerDocument.createRange();
                r.setStartBefore(parentElement);
                ptxt = r.createContextualFragment(this.getOuterHTML());
***************
*** 38,41 ****
--- 37,41 ----
                this.elm=parentElement.lastChild;
                this.css=this.elm.style;
+               this.doc=this.parent.doc;
        } else if (is.ie) {
                var 
parentElement=(this.parent.isDynLayer)?this.parent.elm:this.parent.doc.body;
***************
*** 48,52 ****
                var recycled=this.parent.doc.recycled;
                if (recycled && recycled.length>0 && !DynObject.recreate) {
!               this.elm=recycled[0];
                        Methods.removeFromArray(recycled,recycled[0]);
                } else {
--- 48,52 ----
                var recycled=this.parent.doc.recycled;
                if (recycled && recycled.length>0 && !DynObject.recreate) {
!                       this.elm=recycled[0];
                        Methods.removeFromArray(recycled,recycled[0]);
                } else {
***************
*** 68,72 ****
                if (this.clip) this.setClip(this.clip)
                if (this.z) this.css.zIndex=this.z;
!               this.css.visibility=this.visible? "inherit" : (is.ns4?"hide":"hidden");
                for (var i=0;i<this.doc.images.length;i++) 
this.doc.images[i].lyrobj=this;
                for (i=0;i<this.doc.links.length;i++) this.doc.links[i].lyrobj=this;
--- 68,72 ----
                if (this.clip) this.setClip(this.clip)
                if (this.z) this.css.zIndex=this.z;
!               this.css.visibility=this.visible? "inherit" : "hide";
                for (var i=0;i<this.doc.images.length;i++) 
this.doc.images[i].lyrobj=this;
                for (i=0;i<this.doc.links.length;i++) this.doc.links[i].lyrobj=this;
***************
*** 133,137 ****
        this.css = null;
  };
- 
  DynLayer.prototype.getInnerHTML=function() {
        var s="";
--- 133,136 ----
***************
*** 182,191 ****
        };
  };
! DynLayer.prototype._oldDL_create = DynLayer.prototype.create
  DynLayer.prototype.create = function() {
!       this._oldDL_create()
        this.invokeEvent("resize")
  }
- 
  if (is.ns) {
        DynLayer.prototype._setX=function(){ this.css.left=this.x; }
--- 181,189 ----
        };
  };
! DynLayer.prototype._dynlayer_create = DynLayer.prototype.create
  DynLayer.prototype.create = function() {
!       this._dynlayer_create()
        this.invokeEvent("resize")
  }
  if (is.ns) {
        DynLayer.prototype._setX=function(){ this.css.left=this.x; }
***************
*** 195,199 ****
        DynLayer.prototype._setY=function(){ this.css.pixelTop=this.y; }
  };
- 
  DynLayer.prototype.moveTo=function(x,y) {
        if (x!=null) this.x=x;
--- 193,196 ----
***************
*** 271,276 ****
  DynLayer.prototype.setBgColor=function(color) {
        if (color==null) {
!               if (is.ns4) color=null
!               else color='transparent'
        }
        this.bgColor=color;
--- 268,273 ----
  DynLayer.prototype.setBgColor=function(color) {
        if (color==null) {
!               if (is.ns4) color=null;
!               else color='transparent';
        }
        this.bgColor=color;
***************
*** 284,301 ****
  if (is.ns4) {
        DynLayer.prototype._setHTML=function(html) {
!               var sTmp=(this.w==null)?'<NOBR>'+this.html+'</NOBR>':this.html
!               this.doc.open()
!               this.doc.write(sTmp)
!               this.doc.close()
                for (var i=0;i<this.doc.images.length;i++) 
this.doc.images[i].lyrobj=this;
                for (i=0;i<this.doc.links.length;i++) this.doc.links[i].lyrobj=this;
        }
  } else if (is.ie) {
!       DynLayer.prototype._setHTML=function(html) { 
!               var images = this.elm.all.tags("img")
!               for (var i=0;i<images.length;i++) images[i].lyrobj=this
!               }
  } else {
!       DynLayer.prototype._setHTML=function(html) {;
                sTmp=(this.w==null)?'<NOBR>'+this.html+'</NOBR>':this.html;
                while (this.elm.hasChildNodes()) 
this.elm.removeChild(this.elm.firstChild);
--- 281,299 ----
  if (is.ns4) {
        DynLayer.prototype._setHTML=function(html) {
!               var sTmp=(this.w==null)?'<NOBR>'+this.html+'</NOBR>':this.html;
!               this.doc.open();
!               this.doc.write(sTmp);
!               this.doc.close();
                for (var i=0;i<this.doc.images.length;i++) 
this.doc.images[i].lyrobj=this;
                for (i=0;i<this.doc.links.length;i++) this.doc.links[i].lyrobj=this;
        }
  } else if (is.ie) {
!       DynLayer.prototype._setHTML=function(html) {
!               this.elm.innerHTML=html;
!               var images = this.elm.all.tags("img");
!               for (var i=0;i<images.length;i++) images[i].lyrobj=this;
!       }
  } else {
!       DynLayer.prototype._setHTML=function(html) {
                sTmp=(this.w==null)?'<NOBR>'+this.html+'</NOBR>':this.html;
                while (this.elm.hasChildNodes()) 
this.elm.removeChild(this.elm.firstChild);
***************
*** 312,316 ****
        if (this.css==null) return;
        if (noevt!=false) this.invokeEvent("beforeload");
-       this.elm.innerHTML=html;
        this._setHTML(html);
        if (noevt!=false) this.invokeEvent("load");
--- 310,313 ----
***************
*** 321,327 ****
  DynLayer.prototype.setSize = function(w,h,noevt) {
        this.w=(w==null)?this.w:w<0?0:w;
-       if (this.w==null) return;
        this.h=(h==null)?this.h:h<0?0:h;
!       if (this.h==null) return;
        if (this.css!=null) {
                if (is.ns4) { 
--- 318,323 ----
  DynLayer.prototype.setSize = function(w,h,noevt) {
        this.w=(w==null)?this.w:w<0?0:w;
        this.h=(h==null)?this.h:h<0?0:h;
!       if (this.w==null&&this.h==null) return;
        if (this.css!=null) {
                if (is.ns4) { 
***************
*** 372,384 ****
                if (is.ns4) return this.doc.width;
                else if (is.ie) {
!                               if (is.platform=="mac") this.elm.offsetWidth //Mac 
hack, forces scrollWidth to fill due to IE 5 mac bug
!                       return parseInt(this.elm.scrollWidth);
!                       }
                else {
!                       var tw = this.elm.style.width
!                       this.elm.style.width = "auto";
!                       var w = this.elm.offsetWidth;
!                       this.elm.style.width = tw;
!                       return w;
                }
        };
--- 368,380 ----
                if (is.ns4) return this.doc.width;
                else if (is.ie) {
!                       if (is.platform=="mac") this.elm.offsetWidth;
!               return parseInt(this.elm.scrollWidth);
!               }
                else {
!                       var tw = this.elm.style.width;
!                   this.elm.style.width = "auto";
!               var w = this.elm.offsetWidth;
!               this.elm.style.width = tw;
!               return w;
                }
        };
***************
*** 393,401 ****
                        }
                else {
!                       var th = this.elm.style.height
                        this.elm.style.height = "auto";
!                       var h = this.elm.offsetHeight;
!                       this.elm.style.height = th;
!                       return h;
                }
        }
--- 389,397 ----
                        }
                else {
!                       var th = this.elm.style.height;
                        this.elm.style.height = "auto";
!               var h = this.elm.offsetHeight;
!               this.elm.style.height = th;
!               return h;
                }
        }


_______________________________________________
Dynapi-CVS mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-cvs

Reply via email to