From 7ec0dcfec8e29efb41c1e38619e09ff19afdde56 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sun, 30 Apr 2017 13:42:59 +0300 Subject: [PATCH] Mark touch events as passive --- client/js/libs/slideout.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/js/libs/slideout.js b/client/js/libs/slideout.js index 34faa9a8..93ec86c1 100644 --- a/client/js/libs/slideout.js +++ b/client/js/libs/slideout.js @@ -23,7 +23,7 @@ module.exports = function slideoutMenu(viewport, menu) { function onTouchStart(e) { if (e.touches.length !== 1) { onTouchEnd(); - return false; + return; } var touch = e.touches.item(0); @@ -37,7 +37,7 @@ module.exports = function slideoutMenu(viewport, menu) { touchStartTime = Date.now(); viewport.addEventListener("touchmove", onTouchMove); - viewport.addEventListener("touchend", onTouchEnd); + viewport.addEventListener("touchend", onTouchEnd, {passive: true}); } } @@ -91,7 +91,7 @@ module.exports = function slideoutMenu(viewport, menu) { menuIsMoving = false; } - viewport.addEventListener("touchstart", onTouchStart); + viewport.addEventListener("touchstart", onTouchStart, {passive: true}); return { disable: disableSlideout,