]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fixes #7611, removes swipe up/down from event firing, and only prevents default if...
authorChris Oyler <chris@zurb.com>
Sat, 19 Dec 2015 01:01:52 +0000 (17:01 -0800)
committerChris Oyler <chris@zurb.com>
Sat, 19 Dec 2015 01:01:52 +0000 (17:01 -0800)
js/foundation.util.touch.js

index 928b9938132f08749f072bbd449bf2d7cf70f937..236cdce4ef57c0cacfabc725f02992fec51bef82 100644 (file)
@@ -7,7 +7,7 @@
   $.spotSwipe = {
     version: '1.0.0',
     enabled: 'ontouchstart' in document.documentElement,
-    preventDefault: true,
+    preventDefault: false,
     moveThreshold: 75,
     timeThreshold: 200
   };
       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);
       }