From f5aee67a142677999f6f34a65806a98c5c6afc89 Mon Sep 17 00:00:00 2001 From: John Day Date: Tue, 9 Apr 2013 10:47:00 +0100 Subject: [PATCH] Patch for issue #33 Allow vertical page scrolling whilst touching widget --- jquery.kinetic.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/jquery.kinetic.js b/jquery.kinetic.js index 3e8adb3..f2d07a2 100644 --- a/jquery.kinetic.js +++ b/jquery.kinetic.js @@ -291,6 +291,12 @@ } } } + + if (!settings.y && settings.velocity < 5 && settings.velocityY > 5) { + return false; + } + + return true; }; // Events @@ -307,8 +313,9 @@ var touch; if (mouseDown) { touch = e.originalEvent.touches[0]; - inputmove(touch.clientX, touch.clientY); - if (e.preventDefault) {e.preventDefault();} + if (inputmove(touch.clientX, touch.clientY)) { + if (e.preventDefault) { e.preventDefault(); } + } } }, inputDown: function(e){ @@ -328,8 +335,11 @@ }, inputMove: function(e) { if (mouseDown){ - inputmove(e.clientX, e.clientY); - if (e.preventDefault) {e.preventDefault();} + if (inputmove(e.clientX, e.clientY)) { + if (e.preventDefault) { + e.preventDefault(); + } + } } }, scroll: function(e) {