white-space : pre-wrap; /* CSS 2.1 */\r
white-space : pre-line; /* CSS 3.0 */\r
/* white-space : -pre-wrap; Opera 4-6 */\r
- /* white-space : -o-pre-wrap; Opera 7 */\r
+ white-space : -o-pre-wrap; /* Opera 7 */\r
white-space : -moz-pre-wrap; /* Mozilla */\r
/* white-space : -hp-pre-wrap; HP Printers */\r
white-space : normal\9; /* ie系では、 float要素へ回り込みする、 white-space の効いているテキストの位置が狂う */\r
width : 100%;\r
height : 100%; /* 100% don't work for ie6, so ie6 need to set height as 'XXpx' by js */\r
\r
- user-select : none;\r
- -moz-user-select : none;\r
- -khtml-user-select : none;\r
+ user-select : none;\r
+ -moz-user-select : none;\r
+ -khtml-user-select : none;\r
-webkit-user-select : none;\r
\r
/* this makes the element blocking in IE10 >, you could experiment with the value\r
see for more options this issue; https://github.com/EightMedia/hammer.js/issues/241 */\r
- touch-action : none;\r
+ touch-action : none;\r
-ms-touch-action : none;\r
- touch-callout : none;\r
+ touch-callout : none;\r
-webkit-touch-callout : none;\r
- content-zooming : none;\r
+ content-zooming : none;\r
-ms-content-zooming : none;\r
- user-drag : none;\r
- -khtml-user-drag : none;\r
+ user-drag : none;\r
+ -khtml-user-drag : none;\r
-webkit-user-drag : none;\r
- tap-highlight-color : rgba(0,0,0,0);\r
+ tap-highlight-color : rgba(0,0,0,0);\r
-webkit-tap-highlight-color : rgba(0,0,0,0);\r
}\r
.ActiveX-enabled .mouse-operation-catcher {\r
* http://d.hatena.ne.jp/t-uchima/20051003/p1\r
* MacIEにはattachEventが一応あるけどwindow.attachEventとdocument.attachEventしかなく他の要素にはattachEventはない。\r
*/\r
-if( X.UA.MacIE || X.UA.NetFront ){\r
+if( X.UA.MacIE || X.UA.NetFront < 4 ){\r
X.Dom.DOM_W3C = true;\r
X.Dom.EVENT_DOM0 = true;\r
} else\r
root = X.UI.PageRoot(\r
+ X.UI.HBox(\r
+ {\r
+ //width : '50%',\r
+ height : '50%',\r
+ bgColor : 0x44ffff\r
+ },\r
+ X.UI.Text( 'HTML4', { width : 3 } ),\r
+ X.UI.Text( 'Ruby on Rails' ),\r
+ X.UI.Text( 'js' ),\r
+ X.UI.Text( 'SVG' ),\r
+ X.UI.Text( 'heroku' ),\r
+ X.UI.Text( 'flash' )\r
+ ),\r
X.UI.Box({\r
- width : '10%',\r
- height : '10%',\r
- left : 5,\r
- top : 1,\r
+ width : '25%',\r
+ height : '25%',\r
+ left : '25%',\r
+ top : '50%',\r
bgColor : 0x0000ff\r
}),\r
X.UI.Box({\r
- width : 5,\r
- height : 5,\r
- left : '10%',\r
- bottom : '70%',\r
- bgColor : 0xff0000\r
+ width : '25%',\r
+ height : '25%',\r
+ left : 0,\r
+ bottom : 0,\r
+ bgColor : 0xff0000\r
}),\r
X.UI.VBox(\r
{\r
- width : '50%',\r
- left : '49%',\r
+ width : '40%',\r
+ left : '55%',\r
top : 5,\r
bottom : 5,\r
bgColor : 0x666666,\r
borderWidth : [ 0, 0, 0, 0 ],\r
borderStyle : 'solid dotted',\r
padding : [ 4, 1 ],\r
- sizing : 'border'\r
+ sizing : 'border',\r
+ gapY : 1\r
},\r
X.UI.Box({\r
width : '50%',\r
left : '25%',\r
bgColor : 0x999999\r
}),\r
- X.UI.Text( 'Hello, world!', { width : '100%' } ),\r
- X.UI.Text( '----------------------------', { width : '100%' } ),\r
- text = X.UI.Text( 'PettanR-team. rrrrrrrrrr', { width : '100%' } )\r
- .listen( X.UI.Event.TAP, _onClick )\r
+ X.UI.Text( 'Hello, world!' ),\r
+ X.UI.Text( '----------------------------' ),\r
+ text = X.UI.Text( 'PettanR-team. rrrrrrrrrr' )\r
+ .listen( X.UI.Event.TAP, _onClick ),\r
+ X.UI.HBox(\r
+ {\r
+ width : '100%',\r
+ gapX : 2,\r
+ bgColor : 0xff77ff\r
+ },\r
+ X.UI.Text( 'HTML4', { width : 2 } ),\r
+ X.UI.Text( 'Ruby on Rails', { width : 2 } ),\r
+ X.UI.Text( 'js' ),\r
+ X.UI.Text( 'SVG' ),\r
+ X.UI.Text( 'heroku' ),\r
+ X.UI.Text( 'flash' )\r
+ )\r
)\r
);\r
_root = X.Class._getPrivate( root );\r
// onmouseup, but when touchend has been fired we do nothing.\r
// this is for touchdevices which also fire a mouseup on touchend\r
if( type & MOUSE && touch_triggered ){\r
- return X.Callback.STOP_NOW | X.Callback.STOP_PROPAGATION | X.Callback.PREVENT_DEFAULT;\r
+ return X.Callback.STOP_NOW | X.Callback.PREVENT_DEFAULT;\r
}\r
// mousebutton must be down or a touch event\r
else if (\r
types = [ X.UI.Event._POINTER_MOVE, X.UI.Event._POINTER_UP, X.UI.Event._POINTER_CANCEL ];\r
} else\r
if( X.Dom.EVENT_TOUCH ){\r
- Hammer.EVENT_TYPES_START = [ X.UI.Event._TOUCH_START ];\r
- types = [ X.UI.Event._TOUCH_MOVE, X.UI.Event._MOUSE_MOVE, X.UI.Event._TOUCH_END, X.UI.Event._TOUCH_CANCEL ];\r
+ Hammer.EVENT_TYPES_START = [ X.UI.Event._TOUCH_START, X.UI.Event._MOUSE_DOWN ];\r
+ types = [ X.UI.Event._MOUSE_MOVE, X.UI.Event._MOUSE_UP, X.UI.Event._MOUSE_CANCEL,\r
+ X.UI.Event._TOUCH_MOVE, X.UI.Event._TOUCH_END, X.UI.Event._TOUCH_CANCEL ];\r
} else {\r
Hammer.EVENT_TYPES_START = [ X.UI.Event._MOUSE_DOWN ];\r
types = [ X.UI.Event._MOUSE_MOVE, X.UI.Event._MOUSE_UP, X.UI.Event._MOUSE_CANCEL ];\r
* 自身の contentWidth, contentHeight を元に AUTO な width, height を確定していく\r
*/\r
postMesure : function(){\r
- var attrs = this.attrObject || this.attrClass.prototype || X.UI.AttrClass,\r
- calc = X.UI._AbstractUINode.calcValue,\r
- box = attrs[ X.UI.Attr.Support.sizing.No ],\r
+ var attrs = this.attrObject || this.attrClass.prototype || X.UI.AttrClass,\r
+ calc = X.UI._AbstractUINode.calcValue,\r
+ box = attrs[ X.UI.Attr.Support.sizing.No ],\r
contentW, contentH,\r
contentPlus,\r
paddingT, paddingR, paddingB, paddingL,\r
\r
data.preMesure( w, h );\r
\r
- if( isNeedsDetection && ( data.boxWidth === X.UI.Attr.AUTO || data.boxHeight === X.UI.Attr.AUTO ) ) return;\r
+ if( isNeedsDetection && ( data.boxWidth === X.UI.Attr.AUTO || data.boxHeight === X.UI.Attr.AUTO ) ) return false;\r
\r
_x = data.contentL;\r
_y = data.contentT;\r
if( ( uinodes = data.uinodes ) && ( l = uinodes.length ) ){\r
for( i = 0; i < l; ++i ){\r
node = uinodes[ i ];\r
- node.calculate( false, _x, _y, _w, _h ); \r
+ node.calculate( false, _x, _y, _w, _h );\r
};\r
} else\r
if( data.contentHeight === X.UI.Attr.AUTO ){\r
\r
data.postMesure();\r
data.updateLayout( x + data.boxX, y + data.boxY );\r
+ \r
+ return true;\r
}\r
});\r
\r
},\r
\r
calculate : function( isNeedsDetection, x, y, w, h ){\r
- this.layout.calculate( this, isNeedsDetection, x, y, w, h ); \r
+ var ret = this.layout.calculate( this, isNeedsDetection, x, y, w, h ); \r
this.phase = 4;\r
+ return ret;\r
},\r
\r
capcher : function( x, y ){\r
},\r
\r
calculate : function( data, isNeedsDetection, x, y, w, h ){\r
- var attrs = data.attrObject || data.attrClass.prototype,\r
+ var ret = isNeedsDetection,\r
+ attrs = data.attrObject || data.attrClass.prototype,\r
uinodes = data.uinodes,\r
- l = uinodes && uinodes.length, \r
+ l = uinodes && uinodes.length,\r
+ minFlag = false,\r
childW, childH, gapY,\r
i, _x, _y, _w, node,\r
contentW, contentH, autoW, autoH, detectionPhase;\r
_x = data.contentL;\r
_y = data.contentT;\r
\r
+ if( !detectionPhase ) ret = false;\r
+\r
if( l ){\r
_w = 0;\r
for( i = 0; i < l; ++i ){\r
_y += node.boxHeight + gapY;\r
// 概算のみ\r
if( autoW ){\r
- w = node.boxWidth !== X.UI.Attr.AUTO ?\r
- node.boxWidth :\r
- node.minBoxWidth !== X.UI.Attr.AUTO ?\r
- node.minBoxWidth : 0;\r
+ if( node.boxWidth !== X.UI.Attr.AUTO ){\r
+ w = node.boxWidth;\r
+ } else\r
+ if( node.minBoxWidth !== X.UI.Attr.AUTO ){\r
+ w = node.minBoxWidth;\r
+ minFlag = true;\r
+ } else {\r
+ w = 0;\r
+ };\r
if( _w < w ) _w = w; \r
}; \r
};\r
if( detectionPhase ){\r
if( autoW ) data.contentWidth = _w;\r
if( autoH ) data.contentHeight = _y;\r
+ _y = data.contentT;\r
+ for( i = 0; i < l; ++i ){\r
+ node = uinodes[ i ];\r
+ node.calculate( false, _x, _y, data.contentWidth, data.contentHeight );\r
+ _y += node.boxHeight + gapY;\r
+ };\r
data.postMesure();\r
- } else {\r
- //data.postMesure();\r
};\r
\r
!isNeedsDetection && data.updateLayout( x + data.boxX, y + data.boxY );\r
+ \r
+ return !ret;\r
}\r
});\r
\r
},\r
\r
calculate : function( data, isNeedsDetection, x, y, w, h ){\r
- var attrs = data.attrObject || data.attrClass.prototype,\r
+ var ret = isNeedsDetection,\r
+ attrs = data.attrObject || data.attrClass.prototype,\r
uinodes = data.uinodes,\r
- l = uinodes && uinodes.length, \r
- childW, childH, gapX,\r
- i, _x, _y, _h, node,\r
- contentW, contentH, autoW, autoH, detectionPhase;\r
+ l = uinodes && uinodes.length,\r
+ i,\r
+ contentW, contentH, autoW, autoH, detectionPhase, gapX, \r
+ childW, childH, _x, _y, _h, node, minFlag;\r
\r
data.preMesure( w, h );\r
\r
autoW = contentW === X.UI.Attr.AUTO;\r
autoH = contentH === X.UI.Attr.AUTO;\r
detectionPhase = autoW || autoH;\r
- _x = data.contentL;\r
- _y = data.contentT;\r
+ gapX = X.UI._AbstractUINode.calcValue( attrs[ data.supportAttrs.gapX.No ], contentW );\r
childW = X.UI._AbstractUINode.calcValue( attrs[ data.supportAttrs.childWidth.No ], contentW );\r
childH = X.UI._AbstractUINode.calcValue( attrs[ data.supportAttrs.childHeight.No ], contentH );\r
- gapX = X.UI._AbstractUINode.calcValue( attrs[ data.supportAttrs.gapX.No ], contentW );\r
+ _x = data.contentL;\r
+ _y = data.contentT; \r
+\r
+ if( !detectionPhase ) ret = false;\r
\r
if( l ){\r
_h = 0;\r
node.calculate( detectionPhase, _x, _y, childW, childH );\r
_x += node.boxWidth + gapX;\r
if( autoH ){\r
- h = node.boxHeight !== X.UI.Attr.AUTO ?\r
- node.boxHeight :\r
- node.minBoxHeight !== X.UI.Attr.AUTO ?\r
- node.minBoxHeight : 0;\r
+ if( node.boxHeight !== X.UI.Attr.AUTO ){\r
+ h = node.boxHeight;\r
+ } else\r
+ if( node.minBoxHeight !== X.UI.Attr.AUTO ){\r
+ h = node.minBoxHeight;\r
+ minFlag = true;\r
+ } else {\r
+ h = 0;\r
+ };\r
if( _h < h ) _h = h; \r
};\r
};\r
if( detectionPhase ){\r
if( autoW ) data.contentWidth = _x;\r
if( autoH ) data.contentHeight = _h;\r
+ _x = data.contentL;\r
+ for( i = 0; i < l; ++i ){\r
+ node = uinodes[ i ];\r
+ node.calculate( false, _x, _y, data.contentWidth, data.contentHeight );\r
+ _x += node.boxWidth + gapX;\r
+ };\r
data.postMesure();\r
- } else {\r
- //data.postMesure();\r
};\r
\r
!isNeedsDetection && data.updateLayout( x + data.boxX, y + data.boxY );\r
+ \r
+ return !ret;\r
}\r
});\r
\r