OSDN Git Service

version 0.6.19, working X.UI on async X.Dom.
[pettanr/clientJs.git] / 0.6.x / js / dom / 13_XDomBoxModel.js
index 172365a..7219b08 100644 (file)
@@ -37,32 +37,34 @@ X.Dom.listenOnce( X.Dom.Event.DOM_INIT, function(){
  *  overflow:hidden かつ width か height が設定されていたら、再描画しないでその値を返す
  */
 Node.prototype.width = function(){
-       var elm;
-       if( !this.parent ) return 0;
+       if( !this.parent ){
+               console.log( 'xnode.width() : no parent' );
+               return 0;
+       };
+       Node.root._updateTimerID && Node.root._startUpdate();
        if( document.getElementById ){
                // this.css( X.Dom.Style.Unit.px, 'width' );
-               return ( elm = this._rawNode ) ? elm.offsetWidth : 0;
+               return this._rawNode.offsetWidth;
        } else
        if( document.all ){
-               if( !( elm = this._ie4getRawNode() ) ) return 0;
-               Node.root._updateReserved === true && Node.root._startUpdate();
-               return elm.offsetWidth;
+               return ( this._rawNode || this._ie4getRawNode() ).offsetWidth;
        } else {
                
        };
 };
 
 Node.prototype.height = function(){
-       var elm;
-       if( !this.parent ) return 0;
+       if( !this.parent ){
+               console.log( 'xnode.height() : no parent' );
+               return 0;
+       };
+       Node.root._updateTimerID && Node.root._startUpdate();
        if( document.getElementById ){
                // this.css( X.Dom.Style.Unit.px, 'height' );
-               return ( elm = this._rawNode ) ? elm.offsetHeight : 0;
+               return this._rawNode.offsetHeight;
        } else
        if( document.all ){
-               if( !( elm = this._ie4getRawNode() ) ) return 0;
-               Node.root._updateReserved === true && Node.root._startUpdate();
-               return elm.offsetHeight;                
+               return ( this._rawNode || this._ie4getRawNode() ).offsetHeight;
        } else {
                
        };
@@ -77,35 +79,38 @@ Node.prototype.height = function(){
  */
 // X.Dom.Style.transform,
 Node.prototype.x = function(){
-       var elm;
-       if( !this.parent ) return 0;
+       if( !this.parent ){
+               console.log( 'xnode.x() : no parent' );
+               return 0;
+       };
+       Node.root._updateTimerID && Node.root._startUpdate();
        if( document.getElementById ){
                // this.css( X.Dom.Style.Unit.px, 'left' );
                // this.css( X.Dom.Style.Unit.px, 'translateX' );
-               return ( elm = this._rawNode ) ? elm.offsetLeft : 0;
+               return this._rawNode.offsetLeft;
        } else
        if( document.all ){
-               if( !( elm = this._ie4getRawNode() ) ) return 0;
-               Node.root._updateReserved === true && Node.root._startUpdate();
-               return elm.offsetLeft;          
+               return ( this._rawNode || this._ie4getRawNode() ).offsetLeft;
        } else {
                
        };
 };
 
 Node.prototype.y = function(){
-       var elm;
-       if( !this.parent ) return 0;
+       if( !this.parent ){
+               console.log( 'xnode.y() : no parent' );
+               return 0;
+       };
+       Node.root._updateTimerID && Node.root._startUpdate();
        if( document.getElementById ){
                // this.css( X.Dom.Style.Unit.px, 'top' );
                // this.css( X.Dom.Style.Unit.px, 'transisitonY' );
-               return ( elm = this._rawNode ) ? elm.offsetTop : 0;
+               return this._rawNode.offsetTop;
        } else
        if( document.all ){
-               if( !( elm = this._ie4getRawNode() ) ) return 0;
-               Node.root._updateReserved === true && Node.root._startUpdate();
-               return elm.offsetTop;           
+               return ( this._rawNode || this._ie4getRawNode() ).offsetTop;            
        } else {
                
        };
-};
\ No newline at end of file
+};
+