OSDN Git Service

Version 0.6.190, fix X.UI.ScrollBox & X.UI.Gesture.
[pettanr/clientJs.git] / 0.6.x / js / 02_dom / 03_XDomEvent.js
index 70cffaa..7c94b06 100644 (file)
@@ -171,7 +171,7 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){
                                                'width'         : touch.width || 0,\r
                                                'height'        : touch.height || 0\r
                                        };\r
-                                       console.log( 'e.pointerId = ' + touch.identifier );\r
+                                       //console.log( 'e.pointerId = ' + touch.identifier );\r
                                };\r
                                return events.length === 1 ? events[ 0 ] : events;\r
                        } else {\r
@@ -185,15 +185,14 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){
                                this[ 'type' ]          = pointerEventType;\r
                                this[ 'pointerType' ]   = 'mouse';\r
                                \r
-                               this[ 'button' ]        = e.button !== undefined ? e.button :\r
-                                                                        e.which !== undefined ? e.which - 1 : -1;\r
+                               this[ 'button' ]        = e.button !== undefined ? e.button : e.which !== undefined ? e.which - 1 : -1;\r
                                this[ 'buttons' ]       = e.buttons !== undefined ? e.buttons : this[ 'button' ] === 0 ? 1 : this[ 'button' ] === 1 ? 2 : this[ 'button' ] === 2 ? 4 : 0;\r
                                this[ 'pressure' ]      = ( this[ 'button' ] !== -1 ? 0.5 : 0 );\r
                                \r
                                elm = e.target;\r
                                this[ 'target' ]        = X_Node_getXNode( elm.nodeType === 3 ? elm.parentNode : elm );// defeat Safari bug // xnodetouch.target;\r
                                this[ 'isPrimary' ]     = true;\r
-                               this[ 'hwTimestamp' ]   = this[ 'timestamp' ] = X_Timer_now(); \r
+                               this[ 'hwTimestamp' ]   = this[ 'timestamp' ] = X_Timer_now();\r
                                this[ 'altKey' ]        = e.altKey;\r
                                this[ 'ctrlKey' ]       = e.ctrlKey;\r
                                this[ 'metaKey' ]       = e.metaKey;\r
@@ -350,7 +349,9 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){
                        //      this[ 'offsetX' ]       = e.x - e.srcElement.offsetLeft; // e.x はイベント発生要素の親要素を基準にした座標。\r
                        //      this[ 'offsetY' ]       = e.y - e.srcElement.offsetTop; \r
                        //};\r
-                       \r
+                       this[ 'pressure' ]      = ( this[ 'button' ] !== -1 ? 0.5 : 0 );\r
+                       this[ 'isPrimary' ]     = true;\r
+                       this[ 'hwTimestamp' ]   = this[ 'timestamp' ] = X_Timer_now();\r
                        this[ 'pointerId' ]     = 1;\r
                        this[ 'radiusX' ]       = 0;\r
                        this[ 'radiusY' ]       = 0;\r
@@ -453,16 +454,16 @@ if( !navigator.pointerEnabled ){
                X_Event_Rename[ 'pointerup'       ] = [ 'touchend',   'mouseup' ];\r
                X_Event_Rename[ 'pointermove'     ] = [ 'touchmove',  'mousemove' ];\r
                X_Event_Rename[ 'pointercancel'   ] = 'touchcancel';\r
-               X_Event_Rename[ 'pointerout'      ] = \r
+               //X_Event_Rename[ 'pointerout'      ] = \r
                X_Event_Rename[ 'pointerleave'    ] = 'touchleave';\r
                // X_Event_Rename[ 'click'           ] = [ 'touchstart', 'touchmove', 'touchend' ]; // ループになってしまう!直した!直ってない!\r
        } else {\r
                X_Event_Rename[ 'pointerdown'     ] = 'mousedown';\r
                X_Event_Rename[ 'pointerup'       ] = 'mouseup';\r
                X_Event_Rename[ 'pointermove'     ] = 'mousemove';\r
-               X_Event_Rename[ 'pointercancel'   ] = \r
-               X_Event_Rename[ 'pointerleave'    ] = \r
-               X_Event_Rename[ 'pointerleave'    ] = document.documentElement.onmouseleave !== undefined ? 'mouseleave' : 'mouseout';\r
+               //X_Event_Rename[ 'pointercancel'   ] = \r
+               //X_Event_Rename[ 'pointerout'      ] = \r
+               X_Event_Rename[ 'pointerleave'    ] = X_elmHtml.onmouseleave !== undefined ? 'mouseleave' : 'mouseout';\r
                \r
                // Opera は ブラウザ設定から右クリックの通知を許可すると mousedown で e.button==2 が返る,キャンセルは可能??\r
                X_UA[ 'Opera' ] && ( X_Event_Rename[ 'contextmenu' ] = 'mousedown' );\r