this.xnode[ 'className' ]( 'PageRoot' );
this.creationComplete();
- X_Timer_once( 0, this, this.doFirstCalc );
- },
-
- doFirstCalc : function(){
- this.calculate();
- this.phase = 4;
- X.ViewPort
- [ 'listen' ]( X_EVENT_VIEW_RESIZED, this, this.calculate )
- [ 'listen' ]( X_EVENT_BASE_FONT_RESIZED, this, this.calculate );
+ X_Timer_once( 0, this, XUI_PageRoot_do1stCalculate );
},
reserveCalc : function(){
};
},
calculate : function( e ){
- var size, font, w, h;
+ var cancelable = !e || ( e.type !== X_EVENT_VIEW_RESIZED && e.type !== X_EVENT_BASE_FONT_RESIZED ),
+ size, font, w, h;
- this[ 'dispatch' ]( XUI_Event.LAYOUT_BEFORE );
+ if( this[ 'dispatch' ]( { type : XUI_Event.LAYOUT_BEFORE, 'cancelable' : cancelable } ) & X_Callback_PREVENT_DEFAULT && cancelable ){
+ return X_Callback_NONE;
+ };
size = X[ 'ViewPort' ][ 'getSize' ]();
font = X[ 'ViewPort' ][ 'getBaseFontSize' ]();
this.calcReserved = false;
X_ViewPort[ 'listenOnce' ]( X_EVENT_AFTER_UPDATE, this, XUI_PageRoot_onViewUpdate );
+
+ return X_Callback_NONE;
},
updateCoursor : function( cursor ){
}
);
+function XUI_PageRoot_do1stCalculate(){
+ this.calculate();
+ this.phase = 4;
+ X.ViewPort
+ [ 'listen' ]( X_EVENT_VIEW_RESIZED, this, this.calculate )
+ [ 'listen' ]( X_EVENT_BASE_FONT_RESIZED, this, this.calculate );
+};
+
function XUI_PageRoot_onViewUpdate( e ){
this[ 'dispatch' ]( XUI_Event.LAYOUT_COMPLETE );
};