6 var XUI_ScrollBox_current,
\r
7 XUI_ScrollBox_indicatorV,
\r
8 XUI_ScrollBox_indicatorH;
\r
10 function XUI_ScrollBox_start( scrollBox ){
\r
12 if( scrollBox.hasVScroll ){
\r
13 if( !XUI_ScrollBox_indicatorV ){
\r
14 XUI_ScrollBox_indicatorV = X_Doc_create( 'div' )[ 'className' ]( 'ScrollBox-IndicatorV' );
\r
17 XUI_ScrollBox_indicatorV.parent !== scrollBox.xnode && scrollBox.xnode[ 'append' ]( XUI_ScrollBox_indicatorV );
\r
18 XUI_ScrollBox_indicatorV[ 'animate' ](
\r
21 900, 'circular', 300
\r
24 [ 'listenOnce' ]( [ X_EVENT_CANCELED, XUI_Event.SCROLL_END ], XUI_ScrollBox_indicatorV, XUI_ScrollBox_indicatorHandleEvent );
\r
26 if( scrollBox.hasHScroll ){
\r
27 if( !XUI_ScrollBox_indicatorH ){
\r
28 XUI_ScrollBox_indicatorH = X_Doc_create( 'div' )[ 'className' ]( 'ScrollBox-IndicatorH' );
\r
30 XUI_ScrollBox_indicatorH.parent !== scrollBox.xnode && scrollBox.xnode[ 'append' ]( XUI_ScrollBox_indicatorH );
\r
31 XUI_ScrollBox_indicatorH[ 'animate' ](
\r
34 900, 'circular', 300
\r
37 [ 'listenOnce' ]( [ X_EVENT_CANCELED, XUI_Event.SCROLL_END ], XUI_ScrollBox_indicatorH, XUI_ScrollBox_indicatorHandleEvent );
\r
41 function XUI_ScrollBox_indicatorHandleEvent( e ){
\r
43 case X_EVENT_CANCELED :
\r
44 case XUI_Event.SCROLL_END :
\r
45 console.log( '-fadeout-' );
\r
49 900, 'circular', 300
\r
56 var X_UI_ScrollBox_SUPPORT_ATTRS = {
\r
57 // スクロール開始するために必要な移動距離、縦か横、どちらか制限する場合、より重要
\r
58 directionLockThreshold : [ 10, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.LENGTH ],
\r
59 scrollXEnabled : [ true, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.BOOLEAN ],
\r
60 scrollYEnabled : [ true, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.BOOLEAN ],
\r
61 scrollEnabled : [ true, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.BOOLEAN ],
\r
62 bounceEnabled : [ true, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.BOOLEAN ],
\r
63 bounceTime : [ 300, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.TIME ],
\r
64 useWheel : [ true, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.BOOLEAN ],
\r
65 useKey : [ true, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.BOOLEAN ],
\r
66 hasScrollShadow : [ true, XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.BOOLEAN ],
\r
67 scrollShadowColor : [ '#000', XUI_Dirty.CLEAN, XUI_Attr_USER.UINODE, XUI_Attr_Type.COLOR ]
\r
70 var XUI_ScrollBox = XUI_ChromeBox.inherits(
\r
74 layout : XUI_Layout_Canvas,
\r
76 directionLockThreshold : 10,
\r
77 scrollXEnabled : true,
\r
78 scrollYEnabled : true,
\r
79 scrollEnabled : true,
\r
80 bounceEnabled : true,
\r
81 momentumEnabled : true,
\r
85 hasScrollShadow : true,
\r
86 scrollShadowColor : '#000',
\r
92 directionLocked : '',
\r
95 isInTransition : false,
\r
102 requestFrameID : 0,
\r
108 scrollXMax : 0, // px
\r
109 scrollYMax : 0, // px
\r
110 scrollXRatio : 0, // この値は scroll 不要になっても保持される。 scroll 必要時に参照される
\r
114 absStartX : 0, // px
\r
115 absStartY : 0, // px
\r
120 directionX : 0, // -1, 0, 1
\r
121 directionY : 0, // -1, 0, 1
\r
123 lastScrollWidth : 0,
\r
124 lastScrollHeight : 0,
\r
128 _containerNode : null,
\r
129 xnodeSlider : null,
\r
131 Constructor : function( user, layout, args ){
\r
132 this[ 'Super' ]( user, layout, args );
\r
133 this._containerNode = X_Pair_get( this.containerNode );
\r
134 this.xnodeSlider = this._containerNode.xnode[ 'className' ]( 'ScrollSlider' )[ 'listen' ]( X_EVENT_ANIME_END, this, X_UI_ScrollBox_onAnimeEnd );
\r
135 this.xnode[ 'className' ]( 'ScrollBox' );
\r
138 creationComplete : function(){
\r
139 XUI_Box.prototype.creationComplete.apply( this, arguments );
\r
142 calculate : function(){
\r
143 this.lastScrollWidth = this._containerNode.boxWidth;
\r
144 this.lastScrollHeight = this._containerNode.boxHeight;
\r
145 this.lastBoxWidth = this.boxWidth;
\r
146 this.lastBoxHeight = this.boxHeight;
\r
148 XUI_Box.prototype.calculate.apply( this, arguments );
\r
150 // TODO root の layout_complete 後に。
\r
151 // TODO calculate 前に scroll の解放。
\r
154 this.lastScrollWidth !== this._containerNode.boxWidth ||
\r
155 this.lastScrollHeight !== this._containerNode.boxHeight ||
\r
156 this.lastBoxWidth !== this.boxWidth || this.lastBoxHeight !== this.boxHeight
\r
158 console.log( 'scroll - calc' );
\r
159 XUI_rootData[ 'listenOnce' ]( XUI_Event.LAYOUT_COMPLETE, this, X_UI_ScrollBox_onLayoutComplete );
\r
163 scrollTo : function( x, y, opt_time, opt_easing, opt_release ){
\r
164 //if( this.scrollX === x && this.scrollY === y ) return;
\r
166 opt_time = 0 <= opt_time ? opt_time : 0;
\r
167 opt_easing = opt_easing || 'circular';
\r
168 opt_release = 0 <= opt_release ? opt_release : 300;
\r
170 this.isInTransition = 0 < opt_time;
\r
172 X_UI_ScrollBox_translate( this, x, y, opt_time, opt_easing, opt_release );
\r
175 _remove : function(){
\r
176 XUI_AbstractUINode.prototype._remove.apply( this, arguments );
\r
177 if( this.scrolling ){
\r
185 function X_UI_ScrollBox_onLayoutBefore( e ){
\r
186 if( e[ 'cancelable' ] && this.isInTransition && X_Node_Anime_translateZ ){
\r
187 this[ 'listenOnce' ]( XUI_Event.SCROLL_END, XUI_rootData, XUI_rootData.calculate );
\r
188 return X_CALLBACK_PREVENT_DEFAULT;
\r
190 this.scrollXRatio = this.scrollX / this.scrollXMax;
\r
191 this.scrollYRatio = this.scrollY / this.scrollYMax;
\r
192 this.xnodeSlider[ 'stop' ]();
\r
193 this.isInTransition = false;
\r
194 return X_CALLBACK_NONE;
\r
197 function X_UI_ScrollBox_onLayoutComplete( e ){
\r
198 // scroll の停止、GPU の解除
\r
199 var font = this.fontSize = this.xnodeSlider[ 'call' ]( 'fontSize' );
\r
201 this.scrollXMax = ( this.boxWidth - this._containerNode.boxWidth ) * font | 0;
\r
202 this.scrollYMax = ( this.boxHeight - this._containerNode.boxHeight ) * font | 0;
\r
204 this.hasHScroll = this.scrollXEnabled && ( this.scrollXMax < -1 ); // < 0 だと
\r
205 this.hasVScroll = this.scrollYEnabled && ( this.scrollYMax < -1 );
\r
207 if( !this.hasHScroll ){
\r
208 this.scrollXMax = 0;
\r
211 if( !this.hasVScroll ){
\r
212 this.scrollYMax = 0;
\r
215 delete this.endTime;
\r
216 delete this.directionX;
\r
217 delete this.directionY;
\r
219 X_UI_ScrollBox_resetPosition( this, 0 );
\r
221 if( this.hasHScroll || this.hasVScroll ){
\r
223 if( this.scrolling ){
\r
224 X_UI_ScrollBox_translate( this, this.scrollXMax * this.scrollXRatio, this.scrollYMax * this.scrollYRatio, 100, '', 300 );
\r
227 // shadow の listen には this が必要!
\r
228 // TODO AbstractUI の listen が悪い!
\r
229 this[ 'listen' ]( XUI_Event._POINTER_DOWN, this, X_UI_ScrollBox_onStart )
\r
230 [ 'listen' ]( XUI_Event.DRAG, this, X_UI_ScrollBox_onMove );
\r
231 this[ 'listen' ]( XUI_Event.DRAG_END, this, X_UI_ScrollBox_onEnd );
\r
232 XUI_rootData[ 'listen' ]( XUI_Event.LAYOUT_BEFORE, this, X_UI_ScrollBox_onLayoutBefore );
\r
234 X_UI_ScrollBox_translate( this, this.scrollXMax * this.scrollXRatio, this.scrollYMax * this.scrollYRatio, 100, '', 300 );
\r
235 this.scrolling = true;
\r
239 if( this.scrolling ){
\r
241 this[ 'unlisten' ]( XUI_Event._POINTER_DOWN, this, X_UI_ScrollBox_onStart )
\r
242 [ 'unlisten' ]( XUI_Event.DRAG, this, X_UI_ScrollBox_onMove );
\r
243 this[ 'unlisten' ]( XUI_Event.DRAG_END, this, X_UI_ScrollBox_onEnd );
\r
244 XUI_rootData[ 'unlisten' ]( XUI_Event.LAYOUT_BEFORE, this, X_UI_ScrollBox_onLayoutBefore );
\r
246 ( this.scrollX !== 0 || this.scrollY !== 0 ) && X_UI_ScrollBox_translate( this, 0, 0, 100, '', 300 );
\r
248 delete this.scrolling;
\r
249 delete this.scrollXRatio;
\r
250 delete this.scrollYRatio;
\r
254 // TODO use scrollLeft, scrollTop
\r
255 function X_UI_ScrollBox_translate( that, x, y, opt_time, opt_easing, opt_release ){
\r
256 var scrollBoxH = that.fontSize * that.boxHeight,
\r
257 scrollBoxW = that.fontSize * that.boxWidth,
\r
258 indicatorH, indicatorW;
\r
260 opt_time = 0 <= opt_time ? opt_time : 0;
\r
261 opt_easing = opt_easing === '' ? '' : opt_easing || 'circular';
\r
262 opt_release = 0 <= opt_release ? opt_release : 300;
\r
264 that.xnodeSlider[ 'animate' ](
\r
273 opt_time, opt_easing, opt_release
\r
276 if( X_UA[ 'IE' ] < 6 ){
\r
277 XUI_ScrollBox_indicatorV && XUI_ScrollBox_indicatorV[ 'css' ]( 'left', ( scrollBoxW - that.fontSize * 0.6 | 0 ) + 'px' );
\r
278 XUI_ScrollBox_indicatorH && XUI_ScrollBox_indicatorH[ 'css' ]( 'top' , ( scrollBoxH - that.fontSize * 0.6 | 0 ) + 'px' );
\r
281 if( that.hasVScroll && XUI_ScrollBox_indicatorV ){
\r
282 indicatorH = scrollBoxH * scrollBoxH / ( - that.scrollYMax + scrollBoxH );
\r
283 scrollBoxH -= indicatorH;
\r
285 XUI_ScrollBox_indicatorV
\r
287 height : ( indicatorH | 0 ) + 'px'
\r
291 y : scrollBoxH * that.scrollY / that.scrollYMax
\r
294 y : scrollBoxH * y / that.scrollYMax,
\r
297 opt_time, opt_easing, opt_release
\r
300 if( that.hasHScroll && XUI_ScrollBox_indicatorH ){
\r
301 indicatorW = scrollBoxW * scrollBoxW / ( - that.scrollXMax + scrollBoxW );
\r
302 scrollBoxW -= indicatorW;
\r
303 XUI_ScrollBox_indicatorH
\r
305 width : ( indicatorW | 0 ) + 'px'
\r
309 x : scrollBoxW * that.scrollX / that.scrollXMax
\r
312 x : scrollBoxW * x / that.scrollXMax,
\r
315 opt_time, opt_easing, opt_release
\r
320 that.scrollXEm = x / that.fontSize;
\r
322 that.scrollYEm = y / that.fontSize;
\r
325 function X_UI_ScrollBox_onStart( e ){
\r
326 var ret = X_CALLBACK_NONE;
\r
328 if( !this.scrollEnabled || ( this.initiated && e.pointerType !== this.initiated ) ){
\r
332 this.initiated = e.pointerType;
\r
333 this.moved = false;
\r
336 this.directionX = 0;
\r
337 this.directionY = 0;
\r
338 this.directionLocked = '';
\r
339 this.startTime = X_Timer_now();
\r
342 if( this.isInTransition ){
\r
343 this.isInTransition = false;
\r
344 //console.log( '-1-' );
\r
345 this[ 'dispatch' ]( XUI_Event.SCROLL_END );
\r
347 this.xnodeSlider[ 'stop' ]();
\r
350 this.startX = this.scrollX;
\r
351 this.startY = this.scrollY;
\r
352 this.absStartX = this.scrollX;
\r
353 this.absStartY = this.scrollY;
\r
354 this.pointX = e.pageX;
\r
355 this.pointY = e.pageY;
\r
357 console.log( 'scrollstart ' + e.pageY + e.target.className() );
\r
359 return ret | X_CALLBACK_PREVENT_DEFAULT;
\r
362 function X_UI_ScrollBox_onMove( e ){
\r
363 var ret = X_CALLBACK_NONE,
\r
364 deltaX, deltaY, timestamp,
\r
366 absDistX, absDistY;
\r
367 // 規定以上の move でスクロール開始
\r
369 //console.log( 'scrollmove ' + e.buttons + ' ' + e.button );
\r
371 if( !this.scrollEnabled || e.pointerType !== this.initiated ){
\r
376 if( !this.xnodeSlider[ '_anime' ] ){
\r
377 //console.log( 'gpuレイヤーの用意 ' + e.pageY );
\r
378 //console.log( 'mov1 x:' + this.scrollX + ' y:' + this.scrollY );
\r
379 X_UI_ScrollBox_translate( this, this.scrollX, this.scrollY, 0, '', 300 );
\r
383 deltaX = e.pageX - this.pointX;
\r
384 deltaY = e.pageY - this.pointY;
\r
385 timestamp = X_Timer_now();
\r
387 this.pointX = e.pageX;
\r
388 this.pointY = e.pageY;
\r
390 this.distX += deltaX;
\r
391 this.distY += deltaY;
\r
392 absDistX = Math.abs(this.distX);
\r
393 absDistY = Math.abs(this.distY);
\r
395 // We need to move at least 10 pixels for the scrolling to initiate
\r
396 if( 300 < timestamp - this.endTime && ( absDistX < 10 && absDistY < 10 ) ){
\r
400 // If you are scrolling in one direction lock the other
\r
401 if( !this.directionLocked ){
\r
402 if( absDistX > absDistY + this.directionLockThreshold ){
\r
403 this.directionLocked = 'h'; // lock horizontally
\r
405 if( absDistY >= absDistX + this.directionLockThreshold ){
\r
406 this.directionLocked = 'v'; // lock vertically
\r
408 this.directionLocked = 'n'; // no lock
\r
412 if( this.directionLocked === 'h' ){
\r
415 if( this.directionLocked === 'v' ){
\r
419 deltaX = this.hasHScroll ? deltaX : 0;
\r
420 deltaY = this.hasVScroll ? deltaY : 0;
\r
423 this[ 'dispatch' ]( XUI_Event.SCROLL_BEFORE_MOVE );
\r
425 this.minusX = deltaX;
\r
426 this.minusY = deltaY;
\r
428 XUI_ScrollBox_start( this );
\r
430 this[ 'dispatch' ]( XUI_Event.SCROLL_MOVE );
\r
433 newX = this.scrollX + deltaX;// - this.minusX;
\r
434 newY = this.scrollY + deltaY;// - this.minusY;
\r
436 // Slow down if outside of the boundaries
\r
437 if( 0 < newX || newX < this.scrollXMax ){
\r
438 newX = this.bounceEnabled ? this.scrollX + ( deltaX ) / 3 : 0 < newX ? 0 : this.scrollXMax;
\r
441 if( 0 < newY || newY < this.scrollYMax ){
\r
442 //console.log( 'slow... ' + newY + ' ' + this.scrollYMax );
\r
443 newY = this.bounceEnabled ? this.scrollY + ( deltaY ) / 3 : 0 < newY ? 0 : this.scrollYMax;
\r
446 this.directionX = 0 < deltaX ? -1 : deltaX < 0 ? 1 : 0;
\r
447 this.directionY = 0 < deltaY ? -1 : deltaY < 0 ? 1 : 0;
\r
449 //console.log( 'mov2 x:' + newX + ' y:' + newY );
\r
450 X_UI_ScrollBox_translate( this, newX, newY, 0, '', 300 );
\r
452 if( 300 < timestamp - this.startTime ){
\r
453 this.startTime = timestamp;
\r
454 this.startX = this.scrollX;
\r
455 this.startY = this.scrollY;
\r
458 return ret | X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_CAPTURE_POINTER;
\r
461 function X_UI_ScrollBox_onEnd( e ){
\r
462 var ret = X_CALLBACK_NONE,
\r
466 momentumX, momentumY,
\r
467 duration, distanceX, distanceY;
\r
469 //console.log( e.type + ' onend ' + XUI_Event.POINTER_OUT );
\r
471 if( !this.scrollEnabled || e.pointerType !== this.initiated ){
\r
472 //console.log( e.type + ' onend 1 ' + e.pointerType + ' ' + this.initiated );
\r
476 delete this.isInTransition;
\r
477 delete this.initiated;
\r
478 this.endTime = X_Timer_now();
\r
480 duration = this.endTime - this.startTime;
\r
481 newX = Math.round( this.scrollX );
\r
482 newY = Math.round( this.scrollY );
\r
483 distanceX = Math.abs(newX - this.startX);
\r
484 distanceY = Math.abs(newY - this.startY);
\r
486 // reset if we are outside of the boundaries
\r
487 if( X_UI_ScrollBox_resetPosition( this, this.bounceTime ) ){
\r
488 //console.log( e.type + ' onend 2 ' + XUI_Event.POINTER_OUT );
\r
489 return ret | X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_RELEASE_POINTER;
\r
492 // we scrolled less than 10 pixels
\r
494 this[ 'dispatch' ]( X_EVENT_CANCELED );
\r
495 //console.log( 'we scrolled less than 10 pixels ' + e.pageY );
\r
496 return ret | X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_RELEASE_POINTER;
\r
499 // start momentum animation if needed
\r
500 if( this.momentumEnabled && duration < 300 ){
\r
501 momentumX = this.hasHScroll ?
\r
502 X_UI_ScrollBox_momentum( this.scrollX, this.startX, duration, this.scrollXMax, this.bounceEnabled ? this.boxWidth * this.fontSize : 0, this.deceleration ) :
\r
503 { destination: newX, duration: 0 };
\r
504 momentumY = this.hasVScroll ?
\r
505 X_UI_ScrollBox_momentum( this.scrollY, this.startY, duration, this.scrollYMax, this.bounceEnabled ? this.boxHeight * this.fontSize : 0, this.deceleration ) :
\r
506 { destination: newY, duration: 0 };
\r
507 newX = momentumX.destination;
\r
508 newY = momentumY.destination;
\r
509 time = Math.max( momentumX.duration, momentumY.duration ) | 0;
\r
510 this.isInTransition = true;
\r
512 //console.log( '慣性無し' );
\r
515 if( newX != this.scrollX || newY != this.scrollY ){
\r
516 // change easing function when scroller goes out of the boundaries
\r
517 if( 0 < newX || newX < this.scrollXMax || 0 < newY || newY < this.scrollYMax ){
\r
518 easing = 'quadratic';
\r
521 //console.log( 'end2 x:' + newX + ' y:' + newY + '<-y:' + this.scrollY + ' t:' + time );
\r
522 this.scrollTo( newX, newY, time, easing, 1000 );
\r
524 //console.log( 'end1 x:' + newX + ' y:' + newY );
\r
525 this.scrollTo( newX, newY, 0, '', 1000 ); // ensures that the last position is rounded
\r
526 //console.log( '-3-' );
\r
527 this[ 'dispatch' ]( XUI_Event.SCROLL_END );
\r
530 return ret | X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_RELEASE_POINTER;
\r
533 function X_UI_ScrollBox_resetPosition( that, time ){
\r
534 var x = that.scrollX,
\r
539 if( !that.hasHScroll || 0 < that.scrollX ){
\r
542 if( that.scrollX < that.scrollXMax ){
\r
543 x = that.scrollXMax;
\r
546 if( !that.hasVScroll || 0 < that.scrollY ){
\r
549 if( that.scrollY < that.scrollYMax ){
\r
550 y = that.scrollYMax;
\r
553 if( x === that.scrollX && y === that.scrollY ){
\r
554 //console.log( 'no バウンド y:' + y + ' max:' + that.scrollYMax );
\r
558 //console.log( ' ===> resetPosition - バウンド!' );
\r
559 //console.log( ' x:' + x + ' y:' + y );
\r
560 that.scrollTo( x, y, time, that.bounceEasing, 1000 );
\r
565 function X_UI_ScrollBox_onAnimeEnd( e ){
\r
566 if( e.target !== this.xnodeSlider ){
\r
567 console.log( '- not much -' );
\r
570 if( e.target === this.xnodeSlider && this.isInTransition && !X_UI_ScrollBox_resetPosition( this, this.bounceTime ) ){
\r
571 this.isInTransition = false;
\r
572 //console.log( '-2-' );
\r
573 this[ 'dispatch' ]( XUI_Event.SCROLL_END );
\r
575 //console.log(' -2.1- '+this.isInTransition );
\r
576 return X_CALLBACK_NONE;
\r
579 function X_UI_ScrollBox_momentum( current, start, time, lowerMargin, wrapperSize, deceleration ){
\r
580 var distance = current - start,
\r
581 speed = Math.abs( distance ) / time,
\r
585 deceleration = deceleration === undefined ? 0.0006 : deceleration;
\r
587 destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );
\r
588 duration = speed / deceleration;
\r
590 if( destination < lowerMargin ){
\r
591 destination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;
\r
592 distance = Math.abs( destination - current );
\r
593 duration = distance / speed;
\r
595 if ( destination > 0 ) {
\r
596 destination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;
\r
597 distance = Math.abs( current ) + destination;
\r
598 duration = distance / speed;
\r
602 destination : Math.round( destination ),
\r
603 duration : duration
\r
607 X.UI.ScrollBox = X.UI.ChromeBox.inherits(
\r
611 Constructor : function(){
\r
612 var supports, slider;
\r
614 if( XUI_ScrollBox.prototype.usableAttrs === XUI_ChromeBox.prototype.usableAttrs ){
\r
615 XUI_ScrollBox.prototype.usableAttrs = supports = XUI_Attr_createAttrDef( XUI_Attr_Support, X_UI_ScrollBox_SUPPORT_ATTRS );
\r
617 XUI_ScrollBox.prototype.attrClass = XUI_Attr_preset( XUI_Box.prototype.attrClass, supports, { width : '100%', height : '100%', bgColor : 0x111111 } );
\r
621 XUI_Layout_Vertical,
\r
623 name : 'ScrollBox-Scroller',
\r
624 role : 'container',
\r
631 l = arguments.length, i = 0, j = 1,
\r
634 for( ; i < l; ++i ){
\r
635 arg = arguments[ i ];
\r
636 if( arg[ 'instanceOf' ] && arg[ 'instanceOf' ]( XUI_LayoutBase ) ){
\r
639 if( arg[ 'instanceOf' ] && arg[ 'instanceOf' ]( X.UI.AbstractUINode ) ){
\r
642 if( X_Type_isObject( arg ) ){
\r
643 args[ ++j ] = attr = arg;
\r
644 slider = attr.scrollSlider;
\r
654 slider || X.UI.VBox.apply( 0, args )
\r
659 //attr && this.attr( attr );
\r
661 scrollX : function(){
\r
664 scrollY : function(){
\r
667 scrollWidth : function(){
\r
670 scrollHeight : function(){
\r
673 scrollTo : function( nodeOrX, y ){
\r