1
0
Fork 0
mirror of https://github.com/GuerillaStudio/now-playing synced 2024-11-26 10:21:39 +00:00

Fix passive and non-passive event listeners of mobile menu's gesture

This commit is contained in:
Tixie Salander 2024-11-09 02:41:12 +01:00
parent 358dfc4761
commit 7e5c84b647
No known key found for this signature in database

View file

@ -19,23 +19,23 @@ class MobileMenu {
bindEvents () {
document.addEventListener('touchstart', (event) => {
this.touchStart(event)
}, false)
}, {passive: true}, false)
document.addEventListener('touchmove', (event) => {
this.touchMove(event)
}, false)
}, {passive: false}, false)
document.addEventListener('touchend', (event) => {
this.touchEnd(event)
}, false)
}, {passive: true}, false)
this.btn.addEventListener('click', (event) => {
this.toggleMenu(event)
}, false)
this.overlay.addEventListener('touchstart', (event) => {
this.touchAction = true
}, false)
}, {passive: true}, false)
this.overlay.addEventListener('touchend', (event) => {
this.toggleMenu(event)
this.touchAction = false
}, false)
}, {passive: true}, false)
this.overlay.addEventListener('click', (event) => {
this.toggleMenu(event)
if (this.touchAction) return