higher thresholds for gestures #3311
This commit is contained in:
@@ -56,13 +56,13 @@
|
||||
|
||||
$("body").hammer().bind("panend", function(e) {
|
||||
var percentage = e.gesture.deltaX / window.innerWidth;
|
||||
var swipe = Math.abs(e.gesture.velocityX) > 0.5;
|
||||
var swipe = Math.abs(e.gesture.velocityX) > 0.6;
|
||||
if (Math.abs(e.gesture.deltaY) > 75) {
|
||||
return;
|
||||
} else if ((percentage > 0.3 || (percentage > 0.1 && swipe)) && hasPrev) {
|
||||
} else if ((percentage > 0.4 || (percentage > 0.1 && swipe)) && hasPrev) {
|
||||
$("body").css({"transition-timing-function": "ease", "transition-duration": "0.3s", "opacity": "0", "transform": "translateX(150%)"});
|
||||
$.timeout(300).done(function() {Danbooru.Post.swipe_prev(e)});
|
||||
} else if ((percentage < -0.3 || (percentage < -0.1 && swipe)) && hasNext) {
|
||||
} else if ((percentage < -0.4 || (percentage < -0.1 && swipe)) && hasNext) {
|
||||
$("body").css({"transition-timing-function": "ease", "transition-duration": "0.3s", "opacity": "0", "transform": "translateX(-150%)"});
|
||||
$.timeout(300).done(function() {Danbooru.Post.swipe_next(e)});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user