OSDN Git Service

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