From eb1e738d6df63b57af2b84ccb6d040e806312e89 Mon Sep 17 00:00:00 2001 From: Chris Oyler Date: Fri, 18 Dec 2015 17:01:52 -0800 Subject: [PATCH] fixes #7611, removes swipe up/down from event firing, and only prevents default if parameters for a swipe event are met --- js/foundation.util.touch.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/foundation.util.touch.js b/js/foundation.util.touch.js index 928b99381..236cdce4e 100644 --- a/js/foundation.util.touch.js +++ b/js/foundation.util.touch.js @@ -7,7 +7,7 @@ $.spotSwipe = { version: '1.0.0', enabled: 'ontouchstart' in document.documentElement, - preventDefault: true, + preventDefault: false, moveThreshold: 75, timeThreshold: 200 }; @@ -37,10 +37,11 @@ if(Math.abs(dx) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) { dir = dx > 0 ? 'left' : 'right'; } - else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) { - dir = dy > 0 ? 'down' : 'up'; - } + // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) { + // dir = dy > 0 ? 'down' : 'up'; + // } if(dir) { + e.preventDefault(); onTouchEnd.call(this); $(this).trigger('swipe', dir).trigger('swipe' + dir); } -- 2.47.2