diff --git a/dist/tap.js b/dist/tap.js index eed0ae2..fae3831 100644 --- a/dist/tap.js +++ b/dist/tap.js @@ -121,14 +121,6 @@ if (!utils.fireFakeEvent(e, Tap.options.eventName)) { return e.preventDefault(); } - }, - - emulatedTap: function( e ) { - if ( coords.offset ) { - utils.fireFakeEvent( e, Tap.options.eventName ); - } - - return e.preventDefault(); } }; @@ -142,9 +134,8 @@ attachDeviceEvent('start'); attachDeviceEvent('move'); attachDeviceEvent('end'); - utils.attachEvent(document.documentElement, 'click', handlers['emulatedTap']); - return false; + break; } } diff --git a/dist/tap.min.js b/dist/tap.min.js index 96ac98d..195f495 100644 --- a/dist/tap.min.js +++ b/dist/tap.min.js @@ -1 +1 @@ -!function(a){var b={},c={};c.attachEvent=function(b,c,d){return"addEventListener"in a?b.addEventListener(c,d,!1):void 0},c.fireFakeEvent=function(a,b){return document.createEvent?a.target.dispatchEvent(c.createEvent(b)):void 0},c.createEvent=function(b){if(document.createEvent){var c=a.document.createEvent("HTMLEvents");return c.initEvent(b,!0,!0),c.eventName=b,c}},c.getRealEvent=function(a){return a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches.length?a.originalEvent.touches[0]:a.touches&&a.touches.length?a.touches[0]:a};var d=[{test:("propertyIsEnumerable"in a||"hasOwnProperty"in document)&&(a.propertyIsEnumerable("ontouchstart")||document.hasOwnProperty("ontouchstart")||a.hasOwnProperty("ontouchstart")),events:{start:"touchstart",move:"touchmove",end:"touchend"}},{test:a.navigator.msPointerEnabled,events:{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}},{test:a.navigator.pointerEnabled,events:{start:"pointerdown",move:"pointermove",end:"pointerup"}}];b.options={eventName:"tap",fingerMaxOffset:11};var e,f,g,h,i={};e=function(a){return c.attachEvent(document.documentElement,h[a],g[a])},g={start:function(a){a=c.getRealEvent(a),i.start=[a.pageX,a.pageY],i.offset=[0,0]},move:function(a){return i.start||i.move?(a=c.getRealEvent(a),i.move=[a.pageX,a.pageY],void(i.offset=[Math.abs(i.move[0]-i.start[0]),Math.abs(i.move[1]-i.start[1])])):!1},end:function(d){if(d=c.getRealEvent(d),i.offset[0]