From 4c00a7fdb98ca7ed211ec4412d174ba19a8e7b15 Mon Sep 17 00:00:00 2001 From: Maxime Loizeau Date: Thu, 11 Aug 2016 15:50:46 +0100 Subject: [PATCH 1/2] Prevent infinite update when touching without moving --- src/js/plugin/handler/touch.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/plugin/handler/touch.js b/src/js/plugin/handler/touch.js index 498afc3..b565a28 100644 --- a/src/js/plugin/handler/touch.js +++ b/src/js/plugin/handler/touch.js @@ -128,6 +128,11 @@ function bindTouchHandler(element, i, supportsTouch, supportsIePointer) { return; } + if(!speed.x && !speed.y) { + clearInterval(easingLoop); + return; + } + if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { clearInterval(easingLoop); return; From 7123891d4dca2fe3d7d75c081ff4ebf9c3525df6 Mon Sep 17 00:00:00 2001 From: Maxime Loizeau Date: Thu, 11 Aug 2016 15:55:20 +0100 Subject: [PATCH 2/2] Updated code styling to match repo recommendations --- src/js/plugin/handler/touch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/plugin/handler/touch.js b/src/js/plugin/handler/touch.js index b565a28..ef3a95d 100644 --- a/src/js/plugin/handler/touch.js +++ b/src/js/plugin/handler/touch.js @@ -128,7 +128,7 @@ function bindTouchHandler(element, i, supportsTouch, supportsIePointer) { return; } - if(!speed.x && !speed.y) { + if (!speed.x && !speed.y) { clearInterval(easingLoop); return; }