Permalink
Browse files

Added flag to enable/disable swipeUp & swipeDown

  • Loading branch information...
1 parent d8ed6ad commit 71279d505effbb4f07c2eb314ec809654ee2ddf3 Matt committed with Feb 5, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/touch.js
View
@@ -30,9 +30,12 @@
} else if (touch.x2 > 0 || touch.y2 > 0) {
Math.abs(touch.x1 - touch.x2) > 30 && $(touch.target).trigger('swipe') &&
$(touch.target).trigger('swipe' + (touch.x1 - touch.x2 > 0 ? 'Left' : 'Right'));
- Math.abs(touch.y1 - touch.y2) > 30 && $(touch.target).trigger('swipe') &&
- $(touch.target).trigger('swipe' + (touch.y1 - touch.y2 > 0 ? 'Up' : 'Down'));
- touch.y1 = touch.y2 = touch.x1 = touch.x2 = touch.last = 0;
+ touch.x1 = touch.x2 = touch.last = 0
+ if (Zepto.enableUpDownSwipe) {
+ Math.abs(touch.y1 - touch.y2) > 30 && $(touch.target).trigger('swipe') &&
+ $(touch.target).trigger('swipe' + (touch.y1 - touch.y2 > 0 ? 'Up' : 'Down'));
+ touch.y1 = touch.y2 = 0;
+ }
} else if ('last' in touch) {
touchTimeout = setTimeout(function(){
touchTimeout = null;

0 comments on commit 71279d5

Please sign in to comment.