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:
parent
358dfc4761
commit
7e5c84b647
1 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue