Skip to content

Commit

Permalink
add pull request marcandre#9
Browse files Browse the repository at this point in the history
add pull request marcandre#6
add pull request marcandre#2
  • Loading branch information
vash15 authored and Michele Belluco committed Jul 1, 2016
1 parent e665358 commit 22efd9a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-detect-swipe",
"version": "2.1.2",
"version": "2.1.3",
"description": "Gives easy access to left/right/up/down swipe events for iOS and other touch devices.",
"homepage": "https://github.com/marcandre/detect_swipe",
"repository": {
Expand Down
22 changes: 18 additions & 4 deletions jquery.detect_swipe.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
/**
* jquery.detectSwipe v2.1.2
* jquery.detectSwipe v2.1.3
* jQuery Plugin to obtain touch gestures from iPhone, iPod Touch, iPad and Android
* http://github.com/marcandre/detect_swipe
* Based on touchwipe by Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
*/
(function($) {
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function($) {

$.detectSwipe = {
version: '2.1.2',
enabled: 'ontouchstart' in document.documentElement,
preventDefault: true,
threshold: 20
threshold: (window.devicePixelRatio||1) >= 2 ? 10 : 20,
};

var startX,
Expand All @@ -20,6 +31,7 @@
function onTouchEnd() {
this.removeEventListener('touchmove', onTouchMove);
this.removeEventListener('touchend', onTouchEnd);
this.removeEventListener('touchcancel', onTouchEnd);
isMoving = false;
}

Expand Down Expand Up @@ -51,6 +63,7 @@
isMoving = true;
this.addEventListener('touchmove', onTouchMove, false);
this.addEventListener('touchend', onTouchEnd, false);
this.addEventListener('touchcancel', onTouchEnd, false);
}
}

Expand All @@ -69,4 +82,5 @@
$(this).on('swipe', $.noop);
} };
});
})(jQuery);

}));

0 comments on commit 22efd9a

Please sign in to comment.