mirror of
https://github.com/GuerillaStudio/now-playing
synced 2024-11-30 00:01: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 () {
|
bindEvents () {
|
||||||
document.addEventListener('touchstart', (event) => {
|
document.addEventListener('touchstart', (event) => {
|
||||||
this.touchStart(event)
|
this.touchStart(event)
|
||||||
}, false)
|
}, {passive: true}, false)
|
||||||
document.addEventListener('touchmove', (event) => {
|
document.addEventListener('touchmove', (event) => {
|
||||||
this.touchMove(event)
|
this.touchMove(event)
|
||||||
}, false)
|
}, {passive: false}, false)
|
||||||
document.addEventListener('touchend', (event) => {
|
document.addEventListener('touchend', (event) => {
|
||||||
this.touchEnd(event)
|
this.touchEnd(event)
|
||||||
}, false)
|
}, {passive: true}, false)
|
||||||
this.btn.addEventListener('click', (event) => {
|
this.btn.addEventListener('click', (event) => {
|
||||||
this.toggleMenu(event)
|
this.toggleMenu(event)
|
||||||
}, false)
|
}, false)
|
||||||
this.overlay.addEventListener('touchstart', (event) => {
|
this.overlay.addEventListener('touchstart', (event) => {
|
||||||
this.touchAction = true
|
this.touchAction = true
|
||||||
}, false)
|
}, {passive: true}, false)
|
||||||
this.overlay.addEventListener('touchend', (event) => {
|
this.overlay.addEventListener('touchend', (event) => {
|
||||||
this.toggleMenu(event)
|
this.toggleMenu(event)
|
||||||
this.touchAction = false
|
this.touchAction = false
|
||||||
}, false)
|
}, {passive: true}, false)
|
||||||
this.overlay.addEventListener('click', (event) => {
|
this.overlay.addEventListener('click', (event) => {
|
||||||
this.toggleMenu(event)
|
this.toggleMenu(event)
|
||||||
if (this.touchAction) return
|
if (this.touchAction) return
|
||||||
|
|
Loading…
Reference in a new issue