diff --git a/client/js/slideout.js b/client/js/slideout.js index 63dfba64..46fd498f 100644 --- a/client/js/slideout.js +++ b/client/js/slideout.js @@ -28,20 +28,19 @@ class SlideoutMenu { } function onTouchStart(e) { + touchStartPos = touchCurPos = e.touches.item(0); + if (e.touches.length !== 1) { onTouchEnd(); return; } - const touch = e.touches.item(0); const styles = window.getComputedStyle(menu); menuWidth = parseFloat(styles.width); menuIsAbsolute = styles.position === "absolute"; - if (!menuIsOpen || touch.screenX > menuWidth) { - touchStartPos = touch; - touchCurPos = touch; + if (!menuIsOpen || touchStartPos.screenX > menuWidth) { touchStartTime = Date.now(); document.body.addEventListener("touchmove", onTouchMove, {passive: true});