OSDN Git Service

Version 0.6.138, working X.UI.ScrollBox!, fix Node.prev & Node.next.
[pettanr/clientJs.git] / 0.6.x / js / 20_ui / 20_PageRoot.js
index 43fbb74..8890fd4 100644 (file)
@@ -114,7 +114,7 @@ X.UI._PageRoot = X.UI._Box.inherits(
                        } );
                        
                        // hover や rollover rollout のための move イベントの追加
-                       this.xnodeInteractiveLayer[ 'listen' ]( X.UI.Event.IdToName[ X.UI.Event._POINTER_MOVE ], X_UI_eventRellay );
+                       this.xnodeInteractiveLayer[ 'listen' ]( 'pointermove', X_UI_eventRellay );
                        if( counter[ X.UI.Event._POINTER_MOVE ] ){
                                ++counter[ X.UI.Event._POINTER_MOVE ];
                        } else {
@@ -145,12 +145,16 @@ X.UI._PageRoot = X.UI._Box.inherits(
                        };
                },
                calculate : function( e ){
-                       var size = X[ 'ViewPort' ][ 'getSize' ](),
-                               font = X[ 'ViewPort' ][ 'getBaseFontSize' ](),
-                               w    = size[ 0 ],
-                               h    = size[ 1 ];
-                       this.layout.calculate( this, false, 0, 0, w / font, h / font );
+                       var size, font, w, h;
+                       
+                       this[ 'dispatch' ]( X.UI.Event.LAYOUT_BEFORE );
+                       
+                       size = X[ 'ViewPort' ][ 'getSize' ]();
+                       font = X[ 'ViewPort' ][ 'getBaseFontSize' ]();
+                       this.layout.calculate( this, false, 0, 0, size[ 0 ] / font, size[ 1 ] / font );
                        this.calcReserved = false;
+                       
+                       X_ViewPort[ 'listenOnce' ]( X_EVENT_AFTER_UPDATE, this, XUI_PageRoot_onViewUpdate );
                },
                
                updateCoursor : function( cursor ){
@@ -164,6 +168,10 @@ X.UI._PageRoot = X.UI._Box.inherits(
        }
 );
 
+function XUI_PageRoot_onViewUpdate( e ){
+       this[ 'dispatch' ]( X.UI.Event.LAYOUT_COMPLETE );
+};
+
 X.UI.PageRoot = X.UI.Box.presets(
        'PageRoot',
        X.UI._PageRoot,