X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F20_ui%2F15_ScrollBox.js;h=5e49890b668810226afc62a0017fc1482b257081;hb=3d352d8bf476ab57cc333e8d02d0e6ea5efa69b7;hp=47915ff3ea439fbce02c886aa4efb40dc85e0f4a;hpb=86c591d2888cf7b24365c1950646fb1f6190efd1;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/20_ui/15_ScrollBox.js b/0.6.x/js/20_ui/15_ScrollBox.js index 47915ff..5e49890 100644 --- a/0.6.x/js/20_ui/15_ScrollBox.js +++ b/0.6.x/js/20_ui/15_ScrollBox.js @@ -40,7 +40,6 @@ var XUI_ScrollBox = XUI_ChromeBox.inherits( directionLocked : '', startTime : 0, endTime : 0, - isAnimating : false, isInTransition : false, hasHScroll : false, @@ -133,13 +132,13 @@ var XUI_ScrollBox = XUI_ChromeBox.inherits( function X_UI_ScrollBox_onLayoutBefore( e ){ if( e[ 'cancelable' ] && this.isInTransition && X_Node_Anime_translateZ ){ this[ 'listenOnce' ]( XUI_Event.SCROLL_END, X_UI_rootData, X_UI_rootData.calculate ); - return X_Callback_PREVENT_DEFAULT; + return X_CALLBACK_PREVENT_DEFAULT; }; this.scrollXRatio = this.scrollX ? this.scrollXMax / this.scrollX : 0; this.scrollYRatio = this.scrollY ? this.scrollYMax / this.scrollY : 0; this.xnodeSlider.stop(); this.isInTransition = false; - return X_Callback_NONE; + return X_CALLBACK_NONE; }; function X_UI_ScrollBox_onLayoutComplete( e ){ @@ -223,7 +222,7 @@ function X_UI_ScrollBox_onLayoutComplete( e ){ }; function X_UI_ScrollBox_onStart( e ){ - var ret = X_Callback_NONE; + var ret = X_CALLBACK_NONE; // React to left mouse button only if( e.pointerType === 'mouse' && e.button !== 0 ){ @@ -244,9 +243,10 @@ function X_UI_ScrollBox_onStart( e ){ this.startTime = X_Timer_now(); // スクロール中の停止 - if( this.isInTransition || this.isAnimating ){ - this.isInTransition = this.isAnimating = false; + if( this.isInTransition ){ + this.isInTransition = false; this[ 'dispatch' ]( XUI_Event.SCROLL_END ); + // TODO current位置 this.xnodeSlider.stop(); }; @@ -262,17 +262,17 @@ function X_UI_ScrollBox_onStart( e ){ this[ 'listen' ]( XUI_Event._POINTER_MOVE, this, X_UI_ScrollBox_onMove ); this[ 'listen' ]( [ XUI_Event._POINTER_UP, XUI_Event._POINTER_CANCEL ], this, X_UI_ScrollBox_onEnd ); - return ret | X_Callback_PREVENT_DEFAULT; + return ret | X_CALLBACK_PREVENT_DEFAULT; }; function X_UI_ScrollBox_onMove( e ){ - var ret = X_Callback_NONE, + var ret = X_CALLBACK_NONE, deltaX, deltaY, timestamp, newX, newY, absDistX, absDistY; // 規定以上の move でスクロール開始 -console.log( 'scrollmove ' + e.buttons + ' ' + e.button ); +//console.log( 'scrollmove ' + e.buttons + ' ' + e.button ); if( !this.scrollEnabled || e.pointerType !== this.initiated ){ return ret; @@ -363,11 +363,11 @@ console.log( 'scrollmove ' + e.buttons + ' ' + e.button ); this.startY = this.scrollY; }; // イベントの拘束 - return ret | X_Callback_PREVENT_DEFAULT | X_Callback_CAPTURE_POINTER; + return ret | X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_CAPTURE_POINTER; }; function X_UI_ScrollBox_onEnd( e ){ - var ret = X_Callback_NONE, + var ret = X_CALLBACK_NONE, time = 0, easing = '', newX, newY, @@ -463,8 +463,8 @@ function X_UI_ScrollBox_resetPosition( that, time ){ return false; }; - //console.log( 'バウンド!' ); - //console.log( 'rese x:' + x + ' y:' + y ); + console.log( ' ===> resetPosition - バウンド!' ); + console.log( ' x:' + x + ' y:' + y ); that.scrollTo( x, y, time, that.bounceEasing, 1000 ); return true; @@ -472,13 +472,13 @@ function X_UI_ScrollBox_resetPosition( that, time ){ function X_UI_ScrollBox_onAnimeEnd( e ){ if( e.target !== this.xnodeSlider || !this.isInTransition ){ - return X_Callback_NONE; + return X_CALLBACK_NONE; }; if( !X_UI_ScrollBox_resetPosition( this, this.bounceTime ) ){ this.isInTransition = false; this[ 'dispatch' ]( XUI_Event.SCROLL_END ); }; - return X_Callback_NONE; + return X_CALLBACK_NONE; }; function X_UI_ScrollBox_momentum( current, start, time, lowerMargin, wrapperSize, deceleration ){ @@ -509,7 +509,6 @@ function X_UI_ScrollBox_momentum( current, start, time, lowerMargin, wrapperSize }; }; -// TODO Box の継承に! X.UI.ScrollBox = X.UI.ChromeBox.inherits( 'ScrollBox', X_Class.NONE, @@ -520,7 +519,7 @@ X.UI.ScrollBox = X.UI.ChromeBox.inherits( if( XUI_ScrollBox.prototype.usableAttrs === XUI_ChromeBox.prototype.usableAttrs ){ XUI_ScrollBox.prototype.usableAttrs = supports = XUI_Attr_createAttrDef( XUI_Attr_Support, X_UI_ScrollBox_SUPPORT_ATTRS ); - XUI_ScrollBox.prototype.attrClass = XUI_Attr_preset( XUI_Box.prototype.attrClass, supports, { width : '100%', height : '100%', bgColor : 0x111111 } ); + XUI_ScrollBox.prototype.attrClass = XUI_Attr_preset( XUI_Box.prototype.attrClass, supports, { width : '100%', height : '100%', bgColor : 0x111111 } ); }; var args = [ @@ -580,4 +579,5 @@ X.UI.ScrollBox = X.UI.ChromeBox.inherits( } } -); \ No newline at end of file +); +