OSDN Git Service

Version 0.6.170, X.Audio is working ADVANCED_OPTIMIZATIONS.
[pettanr/clientJs.git] / 0.6.x / js / 20_ui / 05_XUI_Gesture.js
index 3361dfa..ed6bfec 100644 (file)
@@ -57,7 +57,7 @@
                // 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_PREVENT_DEFAULT;\r
+                       return X_CALLBACK_STOP_NOW | X_CALLBACK_PREVENT_DEFAULT;\r
                } else\r
                // mousebutton must be down or a touch event\r
                if( type & TOUCH || //sourceEventType.match(/touch/) || // touch events are always on screen\r
                // and we are now handling a mouse event, we stop that to prevent conflicts\r
                if( enable_detect ){\r
                        // update pointerevent\r
-                       if( Hammer.HAS_POINTEREVENTS ){ //eventType !== Hammer.EVENT_END ){\r
-                               POINTERS[ e.identifier = e.pointerId ] = type & END ? null : e;\r
-                               touches = [];\r
-                               // we can use forEach since pointerEvents only is in IE10\r
-                               for( i = 0, l = POINTERS.length; i < l; ++i ){\r
-                                       POINTERS[ i ] && ( touches[ touches.length ] = POINTERS[ i ] );\r
-                               };\r
-                               numTouches = touches.length;\r
-                               \r
-                               ///console.log( 'numTouches ' + numTouches );\r
-                       } else\r
-                       // touch\r
-                       if ( type & TOUCH ){ //sourceEventType.match(/touch/)) {\r
-                               touches    = Hammer.DO_TOUCHES_FIX && type & END ? [] : e.touches;\r
-                               numTouches = touches.length;\r
-                       } else\r
-                       // mouse\r
-                       if( !touch_triggered ){\r
-                               numTouches = ( type & END ) ? 0 : 1;\r
-                               touches    = numTouches === 0 ? [] : [{\r
-                                       identifier : 1,\r
-                                       pageX      : e.pageX,\r
-                                       pageY      : e.pageY,\r
-                                       target     : e.target\r
-                               }];\r
+\r
+                       POINTERS[ e.pointerId ] = type & END ? null : e;\r
+                       touches    = [];\r
+                       numTouches = -1;\r
+                       // we can use forEach since pointerEvents only is in IE10\r
+                       for( i in POINTERS ){\r
+                               POINTERS[ i ] && ( touches[ ++numTouches ] = POINTERS[ i ] );\r
                        };\r
+                       ++numTouches;\r
+                       ///console.log( 'numTouches ' + numTouches );\r
+\r
                        // if we are in a end event, but when we remove one touch and\r
                        // we still have enough, set eventType to move\r
                        if( 0 < numTouches && type & END ){ // eventType === Hammer.EVENT_END ){\r
                                // only when the instance options have enabled this gesture\r
                                active[ gesture.name ] &&\r
                                        // if a handler returns false, we stop with the detection\r
-                                       ( ret |= ( gesture.handler( e, hammer ) || X_Callback_NONE ) );\r
+                                       ( ret |= ( gesture.handler( e, hammer ) || X_CALLBACK_NONE ) );\r
                        };\r
 \r
                        // endevent, but not the last touch, so dont stop\r
                }\r
        };\r
        \r
-       /**\r
+       /*\r
         * this holds the last move event,\r
         * used to fix empty touchend issue\r
         * see the onTouch event for an explanation\r
         */\r
        var last_move_event = null;\r
 \r
-       /**\r
+       /*\r
         * when the mouse is hold down, this is true\r
         * @type {Boolean}\r
         */\r
        var enable_detect = false;\r
 \r
-       /**\r
+       /*\r
         * when touch events have been fired, this is true\r
         * @type {Boolean}\r
         */\r