| /*! | ||
| * pure-swipe.js - v1.0.6 | ||
| * pure-swipe.js - v1.0.7 | ||
| * Pure JavaScript swipe events | ||
@@ -9,2 +9,2 @@ * https://github.com/john-doherty/pure-swipe | ||
| */ | ||
| !function(t,e){"use strict";"initCustomEvent"in e.createEvent("CustomEvent")&&(t.CustomEvent=function(t,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var u=e.createEvent("CustomEvent");return u.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),u},t.CustomEvent.prototype=t.Event.prototype),e.addEventListener("touchstart",function(t){if("true"===t.target.getAttribute("data-swipe-ignore"))return;l=t.target,i=Date.now(),n=t.touches[0].clientX,u=t.touches[0].clientY,a=0,o=0},!1),e.addEventListener("touchmove",function(t){if(!n||!u)return;var e=t.touches[0].clientX,i=t.touches[0].clientY;a=n-e,o=u-i},!1),e.addEventListener("touchend",function(t){if(l!==t.target)return;var e=parseInt(l.getAttribute("data-swipe-threshold")||"20",10),s=parseInt(l.getAttribute("data-swipe-timeout")||"500",10),r=Date.now()-i,c="";Math.abs(a)>Math.abs(o)?Math.abs(a)>e&&r<s&&(c=a>0?"swiped-left":"swiped-right"):Math.abs(o)>e&&r<s&&(c=o>0?"swiped-up":"swiped-down");""!==c&&(l.dispatchEvent(new CustomEvent(c,{bubbles:!0,cancelable:!0})),console&&console.log&&console.log(c+" fired on "+l.tagName));n=null,u=null,i=null},!1);var n=null,u=null,a=null,o=null,i=null,l=null}(window,document); | ||
| !function(t,e){"use strict";"initCustomEvent"in e.createEvent("CustomEvent")&&(t.CustomEvent=function(t,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var u=e.createEvent("CustomEvent");return u.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),u},t.CustomEvent.prototype=t.Event.prototype),e.addEventListener("touchstart",function(t){if("true"===t.target.getAttribute("data-swipe-ignore"))return;s=t.target,l=Date.now(),n=t.touches[0].clientX,u=t.touches[0].clientY,a=0,i=0},!1),e.addEventListener("touchmove",function(t){if(!n||!u)return;var e=t.touches[0].clientX,l=t.touches[0].clientY;a=n-e,i=u-l},!1),e.addEventListener("touchend",function(t){if(s!==t.target)return;var e=parseInt(s.getAttribute("data-swipe-threshold")||"20",10),o=parseInt(s.getAttribute("data-swipe-timeout")||"500",10),r=Date.now()-l,c="";Math.abs(a)>Math.abs(i)?Math.abs(a)>e&&r<o&&(c=a>0?"swiped-left":"swiped-right"):Math.abs(i)>e&&r<o&&(c=i>0?"swiped-up":"swiped-down");""!==c&&s.dispatchEvent(new CustomEvent(c,{bubbles:!0,cancelable:!0}));n=null,u=null,l=null},!1);var n=null,u=null,a=null,i=null,l=null,s=null}(window,document); |
+1
-1
| { | ||
| "name": "pure-swipe", | ||
| "version": "1.0.6", | ||
| "version": "1.0.7", | ||
| "description": "A 0.7k script that adds swipe events to the DOM for touch enabled devices", | ||
@@ -5,0 +5,0 @@ "main": "src/pure-swipe.js", |
@@ -75,3 +75,3 @@ /*! | ||
| if (console && console.log) console.log(eventType + ' fired on ' + startEl.tagName); | ||
| // if (console && console.log) console.log(eventType + ' fired on ' + startEl.tagName); | ||
| } | ||
@@ -78,0 +78,0 @@ |
204316
-0.03%