OSDN Git Service

Version 0.6.199, bug fixes X.Node.Anime & X.Util.Window & X.Net.OAuth2 & X.UI.*.
[pettanr/clientJs.git] / 0.6.x / js / 20_ui / 20_Root.js
index 5cd2196..5515f8a 100644 (file)
@@ -208,9 +208,12 @@ var XUI_Root = XUI_Box.inherits(
                                size, font, w, h;
                        
                        if( ( this[ 'dispatch' ]( { type : XUI_Event.LAYOUT_BEFORE, 'cancelable' : cancelable } ) & X_CALLBACK_PREVENT_DEFAULT ) && cancelable ){
+                               console.log( 'Layout のキャンセル' );
                                return X_CALLBACK_NONE;
                        };
                        
+                       console.log( 'レイアウト開始' );
+                       
                        XUI_mousemoveFix && XUI_mousemoveFixResetScroll();
                        
                        size = X[ 'ViewPort' ][ 'getSize' ]();
@@ -219,9 +222,14 @@ var XUI_Root = XUI_Box.inherits(
                        this.updateLayout();
                        
                        this.calcReserved = false;
-                       
-                       X_ViewPort[ 'listenOnce' ]( X_EVENT_AFTER_UPDATE, this, XUI_Root_onViewUpdate );
-                       
+
+                       // size を測りながらレイアウトする結果、アップデートがない場合がある
+                       if( X_Node_updateTimerID ){
+                               X_ViewPort[ 'listenOnce' ]( X_EVENT_AFTER_UPDATE, this, XUI_Root_onViewUpdate );
+                       } else {
+                               this[ 'asyncDispatch' ]( XUI_Event.LAYOUT_COMPLETE );
+                       };
+
                        return X_CALLBACK_NONE;
                },
                
@@ -240,6 +248,7 @@ function XUI_Root_do1stCalculate(){
 };
 
 function XUI_Root_onViewUpdate( e ){
+       console.log( 'レイアウト完了' );
        this[ 'dispatch' ]( XUI_Event.LAYOUT_COMPLETE );
 };