OSDN Git Service

Version 0.6.114, add AudioSprite, etc.
[pettanr/clientJs.git] / 0.6.x / js / 20_ui / 20_PageRoot.js
index 37f0a41..fd84be3 100644 (file)
@@ -1,7 +1,8 @@
 
 X.UI._eventRellay = function( e ){
-       var x       = e.clientX / X.Dom.baseFontSize,
-               y       = e.clientY / X.Dom.baseFontSize,
+       var font    = X.ViewPort.getBaseFontSize(),
+               x       = e.clientX / font,
+               y       = e.clientY / font,
                type    = X.UI.Event.NameToID[ e.type ],
                i       = 0,
                data    = X.UI.currentRootData,
@@ -82,12 +83,12 @@ X.UI._PageRoot = X.UI._Box.inherits(
                _eventBusy            : false,
                
                Constructor : function( layout, args ){
-                       this.SuperConstructor( layout, args );
+                       this.Super( layout, args );
                        
-                       if( X.Dom.readyState === X.Dom.Event.XDOM_READY ){
+                       if( X_ViewPort_readyState === X.Event.XDOM_READY ){
                                X.Timer.once( 0, this, this.start );
                        } else {
-                               X.Dom.listenOnce( X.Dom.Event.XDOM_READY, this, this.start );
+                               X.ViewPort.listenOnce( X.Event.XDOM_READY, this, this.start );
                        };
                        
                        this.hoverList    = [];
@@ -105,17 +106,16 @@ X.UI._PageRoot = X.UI._Box.inherits(
                        
                        // this.xnodeInteractiveLayer の前に追加する!
 
-                       this.addToParent( X.Dom.Node._body );
+                       this.addToParent( X.Doc.body );
                        
-                       this.xnodeInteractiveLayer = X.Dom.Node._body.create( 'div', {
+                       this.xnodeInteractiveLayer = X.Doc.body.create( 'div', {
                                'class'      : 'mouse-operation-catcher',
                                unselectable : 'on'
                        } );
                        
                        // hover や rollover rollout のための move イベントの追加
-                       // X.Dom.Event.activate, X.Dom.Event.deactivate ?
                        // mouseout, mouseover
-                       //if( X.Dom.EVENT_POINTER ){
+                       //if( X_UA_HID.POINTER ){
                                this.xnodeInteractiveLayer.listen( X.UI.Event.IdToName[ X.UI.Event._POINTER_MOVE ], X.UI._eventRellay );
                                if( counter[ X.UI.Event._POINTER_MOVE ] ){
                                        ++counter[ X.UI.Event._POINTER_MOVE ];
@@ -142,9 +142,9 @@ X.UI._PageRoot = X.UI._Box.inherits(
                doFirstCalc : function(){
                        this.calculate();
                        this.phase = 4;
-                       X.Dom
-                               .listen( X.Dom.Event.VIEW_RESIZED, this, this.calculate )
-                               .listen( X.Dom.Event.BASE_FONT_RESIZED, this, this.calculate );
+                       X.ViewPort
+                               .listen( X.Event.VIEW_RESIZED, this, this.calculate )
+                               .listen( X.Event.BASE_FONT_RESIZED, this, this.calculate );
                },
                
                reserveCalc : function(){
@@ -154,16 +154,10 @@ X.UI._PageRoot = X.UI._Box.inherits(
                        };
                },
                calculate : function( e ){
-                       var font = X.Dom.baseFontSize,
-                               size, w, h;
-                       if( !e ){
-                               size = X.Dom.getSize();
-                               w    = size[ 0 ];
+                       var size = X.ViewPort.getSize(),
+                               font = X.ViewPort.getBaseFontSize(),
+                               w    = size[ 0 ],
                                h    = size[ 1 ];
-                       } else {
-                               w = e.w;
-                               h = e.h;
-                       };
                        this.layout.calculate( this, false, 0, 0, w / font, h / font );
                        this.calcReserved = false;
                },