OSDN Git Service

Version 0.6.194, X.UI.Page working.
[pettanr/clientJs.git] / 0.6.x / js / 20_ui / 15_ScrollBox.js
index 323b95b..f7d334b 100644 (file)
@@ -14,7 +14,7 @@ function XUI_ScrollBox_start( scrollBox ){
                        XUI_ScrollBox_indicatorV = X_Doc_create( 'div' )[ 'className' ]( 'ScrollBox-IndicatorV' );\r
                        \r
                };\r
-               XUI_ScrollBox_indicatorV.parent !== scrollBox.xnode && scrollBox.xnode[ 'append' ]( XUI_ScrollBox_indicatorV );\r
+               scrollBox.xnode[ 'append' ]( XUI_ScrollBox_indicatorV );\r
                XUI_ScrollBox_indicatorV[ 'animate' ](\r
                                { opacity : 0 },\r
                                { opacity : 1 },\r
@@ -27,7 +27,7 @@ function XUI_ScrollBox_start( scrollBox ){
                if( !XUI_ScrollBox_indicatorH ){\r
                        XUI_ScrollBox_indicatorH = X_Doc_create( 'div' )[ 'className' ]( 'ScrollBox-IndicatorH' );\r
                };\r
-               XUI_ScrollBox_indicatorH.parent !== scrollBox.xnode && scrollBox.xnode[ 'append' ]( XUI_ScrollBox_indicatorH );\r
+               scrollBox.xnode[ 'append' ]( XUI_ScrollBox_indicatorH );\r
                XUI_ScrollBox_indicatorH[ 'animate' ](\r
                                { opacity : 0 },\r
                                { opacity : 1 },\r
@@ -156,7 +156,7 @@ var XUI_ScrollBox = XUI_ChromeBox.inherits(
                                        this.lastBoxWidth    !== this.boxWidth    || this.lastBoxHeight    !== this.boxHeight\r
                                ){\r
                                        console.log( 'scroll - calc' );\r
-                                       X_UI_rootData[ 'listenOnce' ]( XUI_Event.LAYOUT_COMPLETE, this, X_UI_ScrollBox_onLayoutComplete );\r
+                                       XUI_rootData[ 'listenOnce' ]( XUI_Event.LAYOUT_COMPLETE, this, X_UI_ScrollBox_onLayoutComplete );\r
                                };\r
                },\r
        \r
@@ -174,8 +174,18 @@ var XUI_ScrollBox = XUI_ChromeBox.inherits(
                \r
                _remove : function(){\r
                        XUI_AbstractUINode.prototype._remove.apply( this, arguments );\r
+                       \r
                        if( this.scrolling ){\r
-                               // remove scroll\r
+                               // scroller 削除\r
+                               this[ 'unlisten' ]( XUI_Event._POINTER_DOWN, X_UI_ScrollBox_onStart )\r
+                                       [ 'unlisten' ]( XUI_Event.DRAG, X_UI_ScrollBox_onMove )\r
+                                       [ 'unlisten' ]( XUI_Event.DRAG_END, X_UI_ScrollBox_onEnd );\r
+                               XUI_rootData[ 'unlisten' ]( XUI_Event.LAYOUT_BEFORE, this, X_UI_ScrollBox_onLayoutBefore );\r
+                               \r
+                               XUI_rootData[ 'unlisten' ]( XUI_Event.LAYOUT_COMPLETE, this, X_UI_ScrollBox_onLayoutComplete );\r
+                               this[ 'unlisten' ]( XUI_Event.SCROLL_END, XUI_rootData, XUI_rootData.calculate );\r
+                               \r
+                               this.xnodeSlider[ 'stop' ]();\r
                        };\r
                }\r
                \r
@@ -184,7 +194,7 @@ var XUI_ScrollBox = XUI_ChromeBox.inherits(
 \r
 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
+               this[ 'listenOnce' ]( XUI_Event.SCROLL_END, XUI_rootData, XUI_rootData.calculate );\r
                return X_CALLBACK_PREVENT_DEFAULT;\r
        };\r
        this.scrollXRatio = this.scrollX / this.scrollXMax;\r
@@ -224,12 +234,10 @@ function X_UI_ScrollBox_onLayoutComplete( e ){
                        X_UI_ScrollBox_translate( this, this.scrollXMax * this.scrollXRatio, this.scrollYMax * this.scrollYRatio, 100, '', 300 );\r
                } else {\r
                        // scroller 作る\r
-                       // shadow の listen には this が必要!\r
-                       // TODO AbstractUI の listen が悪い!\r
-                       this[ 'listen' ]( XUI_Event._POINTER_DOWN, this, X_UI_ScrollBox_onStart )\r
-                               [ 'listen' ]( XUI_Event.DRAG, this, X_UI_ScrollBox_onMove );\r
-       this[ 'listen' ]( XUI_Event.DRAG_END, this, X_UI_ScrollBox_onEnd );\r
-                       X_UI_rootData[ 'listen' ]( XUI_Event.LAYOUT_BEFORE, this, X_UI_ScrollBox_onLayoutBefore );\r
+                       this[ 'listen' ]( XUI_Event._POINTER_DOWN, X_UI_ScrollBox_onStart )\r
+                               [ 'listen' ]( XUI_Event.DRAG, X_UI_ScrollBox_onMove )\r
+                               [ 'listen' ]( XUI_Event.DRAG_END, X_UI_ScrollBox_onEnd );\r
+                       XUI_rootData[ 'listen' ]( XUI_Event.LAYOUT_BEFORE, this, X_UI_ScrollBox_onLayoutBefore );\r
                        \r
                        X_UI_ScrollBox_translate( this, this.scrollXMax * this.scrollXRatio, this.scrollYMax * this.scrollYRatio, 100, '', 300 );\r
                        this.scrolling = true;\r
@@ -238,10 +246,10 @@ function X_UI_ScrollBox_onLayoutComplete( e ){
        // scroll 不要\r
        if( this.scrolling ){\r
                // scroller 削除\r
-               this[ 'unlisten' ]( XUI_Event._POINTER_DOWN, this, X_UI_ScrollBox_onStart )\r
-                       [ 'unlisten' ]( XUI_Event.DRAG, this, X_UI_ScrollBox_onMove );\r
-       this[ 'unlisten' ]( XUI_Event.DRAG_END, this, X_UI_ScrollBox_onEnd );\r
-               X_UI_rootData[ 'unlisten' ]( XUI_Event.LAYOUT_BEFORE, this, X_UI_ScrollBox_onLayoutBefore );\r
+               this[ 'unlisten' ]( XUI_Event._POINTER_DOWN, X_UI_ScrollBox_onStart )\r
+                       [ 'unlisten' ]( XUI_Event.DRAG, X_UI_ScrollBox_onMove )\r
+                       [ 'unlisten' ]( XUI_Event.DRAG_END, X_UI_ScrollBox_onEnd );\r
+               XUI_rootData[ 'unlisten' ]( XUI_Event.LAYOUT_BEFORE, this, X_UI_ScrollBox_onLayoutBefore );\r
                \r
                ( this.scrollX !== 0 || this.scrollY !== 0 ) && X_UI_ScrollBox_translate( this, 0, 0, 100, '', 300 );\r
                \r
@@ -526,6 +534,7 @@ function X_UI_ScrollBox_onEnd( e ){
                //console.log( '-3-' );\r
                this[ 'dispatch' ]( XUI_Event.SCROLL_END );             \r
        };\r
+\r
        return ret | X_CALLBACK_PREVENT_DEFAULT | X_CALLBACK_RELEASE_POINTER;\r
 };\r
 \r