OSDN Git Service

Version 0.6.53, fix for X.Dom.Event.BASE_FONT_RESIZED.
authoritozyun <itozyun@user.sourceforge.jp>
Thu, 10 Jul 2014 06:08:02 +0000 (15:08 +0900)
committeritozyun <itozyun@user.sourceforge.jp>
Thu, 10 Jul 2014 06:08:02 +0000 (15:08 +0900)
0.6.x/js/dom/10_XDom.js
0.6.x/js/main.js
0.6.x/js/ui/06_AbstractUINode.js
0.6.x/js/ui/20_PageRoot.js

index 796d07b..4b88126 100644 (file)
@@ -37,7 +37,7 @@ X.Dom = X.Class._override(
                                        \r
                                        size = Node._fontSizeNode._rawNode.offsetHeight;\r
                                        if( X.Dom.baseFontSize !== size ){\r
-                                               X.Dom.baseFontSize && X.Dom.asyncDispatch( 0, { type : X.Dom.Event.BASE_FONT_RESIZED, size : size } );\r
+                                               X.Dom.baseFontSize && X.Dom.asyncDispatch( 0, { type : X.Dom.Event.BASE_FONT_RESIZED, fontSize : size, w : X.Dom.w, h : X.Dom.h  } );\r
                                                X.Dom.baseFontSize = size;\r
                                        };\r
                                        \r
@@ -258,7 +258,7 @@ if( !X.UA.IE || 9 <= X.UA.IE ){
        X.Dom._detectFontSize = function(){\r
                var size = Node._fontSizeNode._rawNode.offsetHeight;\r
                if( X.Dom.baseFontSize !== size ){\r
-                       X.Dom.baseFontSize && X.Dom.asyncDispatch( 0, { type : X.Dom.Event.BASE_FONT_RESIZED, size : size } );\r
+                       X.Dom.baseFontSize && X.Dom.asyncDispatch( 0, { type : X.Dom.Event.BASE_FONT_RESIZED, fontSize : size, w : X.Dom.w, h : X.Dom.h } );\r
                        X.Dom.baseFontSize = size;\r
                };\r
        };\r
index 6eb6d97..aa91895 100644 (file)
@@ -21,7 +21,7 @@ PageRoot(
                        bottom      : 5,\r
                        bgColor     : 0x666666,\r
                        borderColor : 0x111111,\r
-                       borderWidth : [ 0, 1, 0, 0 ],\r
+                       borderWidth : [ 0, 0, 0, 0 ],\r
                        borderStyle : 'solid dotted',\r
                        padding     : [ 2, 1.5 ],\r
                        sizing      : 'border'\r
@@ -32,8 +32,10 @@ PageRoot(
                        left        : '30%',\r
                        bgColor     : 0x999999\r
                }),\r
-               Text( 'Hello,world!' ),\r
-               Text( '----------------------------' ),\r
-               Text( 'PettanR team' )\r
+               Text( 'Hello, world!', { width : '100%' } ),\r
+               Text( '----------------------------', { width : '100%' } ),\r
+               txt = Text( 'PettanR-team. rrrrrrrrrr', { width : '100%' } )\r
        )\r
-);
\ No newline at end of file
+);\r
+\r
+_text = X.Class._getPrivate( txt );\r
index 82a9d65..0897a62 100644 (file)
@@ -620,7 +620,7 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                                        w !== this.contentWidth && xnode.css( 'width', _AbstractUINode.ceil( this.contentWidth ) + 'em' );\r
                                                        \r
                                                        if( h === X.UI.Attr.AUTO ){\r
-                                                               this.contentHeight = h = xnode.scrollHeight() / xnode._getCharSize(); // scrollHeight() ??\r
+                                                               this.contentHeight = h = xnode.css( 'height', 'auto' ).scrollHeight() / xnode._getCharSize(); // scrollHeight() ??\r
                                                                this.scrollHeight  = h + this.contentT + this.contentB;\r
                                                                if( this.maxContentHeight < h - this.boxSizingOffsetTB ) this.contentHeight = this.maxContentHeight + this.boxSizingOffsetTB;\r
                                                                if( h - this.boxSizingOffsetTB < this.minContentHeight ) this.contentHeight = this.minContentHeight + this.boxSizingOffsetTB;\r
@@ -635,21 +635,21 @@ var _AbstractUINode = X.EventDispatcher.inherits(
                                                                xnode.css( 'width', _AbstractUINode.ceil( w ) + 'em' );\r
                                                                \r
                                                                this.lastContentWidth  = w;\r
-                                                               this.contentHeight = h = xnode.scrollHeight() / xnode._getCharSize();\r
+                                                               this.contentHeight = h = xnode.css( 'height', 'auto' ).scrollHeight() / xnode._getCharSize();\r
                                                                this.scrollWidth       = w + this.contentL + this.contentR;\r
                                                                this.scrollHeight      = h + this.contentT + this.contentB;\r
                                                                if( this.maxContentHeight < h - this.boxSizingOffsetTB ) this.contentHeight = this.maxContentHeight + this.boxSizingOffsetTB;\r
                                                                if( h - this.boxSizingOffsetTB < this.minContentHeight ) this.contentHeight = this.minContentHeight + this.boxSizingOffsetTB;                                                           \r
                                                        } else {\r
                                                                this.contentHeight = this.lastContentHeight = h =\r
-                                                                       this.lastContentHeight === -1 ? xnode.scrollHeight() / xnode._getCharSize() : this.lastContentHeight;\r
+                                                                       this.lastContentHeight === -1 ? xnode.css( 'height', 'auto' ).scrollHeight() / xnode._getCharSize() : this.lastContentHeight;\r
                                                                this.scrollWidth   = w + this.contentL + this.contentR;\r
                                                                this.scrollHeight  = h + this.contentT + this.contentB;\r
                                                        };\r
                                                } else\r
                                                if( dirty !== X.UI.Dirty.LAYOUT ){\r
                                                        this.contentWidth  = this.lastContentWidth  = w; //xnode.width();\r
-                                                       this.contentHeight = this.lastContentHeight = xnode.scrollHeight() / xnode._getCharSize();\r
+                                                       this.contentHeight = this.lastContentHeight = xnode.css( 'height', 'auto' ).scrollHeight() / xnode._getCharSize();\r
                                                        this.scrollWidth   = this.contentWidth  + this.contentL + this.contentR;\r
                                                        this.scrollHeight  = this.contentHeight + this.contentT + this.contentB;\r
                                                } else {\r
index 2a658aa..ad23050 100644 (file)
@@ -130,7 +130,9 @@ var _PageRoot = _Box.inherits(
                doFirstCalc : function(){
                        this.calculate();
                        this.phase = 4;
-                       X.Dom.listen( X.Dom.Event.VIEW_RESIZED, this, this.calculate );
+                       X.Dom
+                               .listen( X.Dom.Event.VIEW_RESIZED, this, this.calculate )
+                               .listen( X.Dom.Event.BASE_FONT_RESIZED, this, this.calculate );
                },
                
                reserveCalc : function(){