From 797731262a2328980c9c9222ebf164c72acf28f3 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Fri, 13 Jul 2018 10:41:12 +0300 Subject: [PATCH] Fix menu swiping --- client/js/slideout.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/js/slideout.js b/client/js/slideout.js index 34734be8..336a962b 100644 --- a/client/js/slideout.js +++ b/client/js/slideout.js @@ -35,7 +35,7 @@ function onTouchStart(e) { return; } - const styles = window.getComputedStyle(this.menu); + const styles = window.getComputedStyle(SlideoutMenu.menu); menuWidth = parseFloat(styles.width); menuIsAbsolute = styles.position === "absolute"; @@ -65,7 +65,7 @@ function onTouchMove(e) { const devicePixelRatio = window.devicePixelRatio || 2; if (Math.abs(distX) > devicePixelRatio) { - this.viewport.classList.toggle("menu-dragging", true); + SlideoutMenu.viewport.classList.toggle("menu-dragging", true); menuIsMoving = true; } } @@ -85,8 +85,8 @@ function onTouchMove(e) { distX = 0; } - this.menu.style.transform = "translate3d(" + distX + "px, 0, 0)"; - this.sidebarOverlay.style.opacity = distX / menuWidth; + SlideoutMenu.menu.style.transform = "translate3d(" + distX + "px, 0, 0)"; + SlideoutMenu.sidebarOverlay.style.opacity = distX / menuWidth; } function onTouchEnd() { @@ -99,9 +99,9 @@ function onTouchEnd() { document.body.removeEventListener("touchmove", onTouchMove); document.body.removeEventListener("touchend", onTouchEnd); - this.viewport.classList.toggle("menu-dragging", false); - this.menu.style.transform = null; - this.sidebarOverlay.style.opacity = null; + SlideoutMenu.viewport.classList.toggle("menu-dragging", false); + SlideoutMenu.menu.style.transform = null; + SlideoutMenu.sidebarOverlay.style.opacity = null; touchStartPos = null; touchCurPos = null;