OSDN Git Service

Version 0.6.143, fix X.UI.ScrollBox for iOS3.
[pettanr/clientJs.git] / 0.6.x / js / 02_dom / 03_XDomEvent.js
index bcfe934..a58bead 100644 (file)
@@ -133,17 +133,17 @@ if( !X_UA[ 'IE' ] || 9 <= X_UA[ 'IE' ] ){
                                                'isPrimary'     : true,\r
                                                'hwTimestamp'   : time,\r
                                                'timestamp'     : time,\r
-                                               'button'        : e.button,\r
-                                               'buttons'       : e.buttons || e.button,\r
+                                               'button'        : /*e.button ||*/ ( force ? 0 : -1 ),\r
+                                               'buttons'       : /*e.buttons || e.button ||*/ ( force ? 1 : 0 ),\r
                                                'altKey'        : altKey,\r
                                                'ctrlKey'       : ctrlKey,\r
                                                'metaKey'       : metaKey,\r
                                                'shiftKey'      : shiftKey,\r
-                                               'pointerId'     : touch.identifier + 2,\r
+                                               'pointerId'     : touch.identifier + 2, // iOS4 は 変換が必要!\r
                                                //screenX       : touch.screenX,\r
                                                //screenY       : touch.screenY,\r
-                                               'clientX'       : touch.clientX,\r
-                                               'clientY'       : touch.clientY,\r
+                                               'clientX'       : touch.clientX || ( touch.pageX - X_ViewPort_scrollX ), // iOS4以下は clientX が undefined, コードでは入れ子のスクロールに対応できない\r
+                                               'clientY'       : touch.clientY || ( touch.pageY - X_ViewPort_scrollY ),\r
                                                'pageX'         : touch.pageX,\r
                                                'pageY'         : touch.pageY,\r
                                                'offsetX'       : touch.offsetX, // 要素上の座標を取得 \r
@@ -155,6 +155,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
                                };\r
                                return events.length === 1 ? events[ 0 ] : events;\r
                        } else {\r