fixing touch
This commit is contained in:
parent
0403cdef8c
commit
85bb92bb4f
1 changed files with 4 additions and 8 deletions
|
|
@ -20,7 +20,7 @@ class Dialog {
|
|||
|
||||
dialogListener(event) {
|
||||
console.log(event)
|
||||
if (event.key === 'Enter' || event.type === 'click' || event.type === 'touchend') {
|
||||
if (event.key === 'Enter' || event.type === 'click' || event.type === 'touchstart') {
|
||||
event.currentTarget.self.startIntroDialogSequence()
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ class Dialog {
|
|||
startIntroDialogSequence() {
|
||||
document.removeEventListener("keydown", this.dialogListener);
|
||||
document.removeEventListener('click', this.dialogListener)
|
||||
document.removeEventListener('touchend', this.dialogListener)
|
||||
document.removeEventListener('touchstart', this.dialogListener)
|
||||
if (this.currentDialogIndex > this.dialogOrder.length - 1) {
|
||||
this.dialogElem.style.display = 'none'
|
||||
dialogMode = false
|
||||
|
|
@ -53,12 +53,8 @@ class Dialog {
|
|||
|
||||
var self = this
|
||||
document.addEventListener('keydown', this.dialogListener)
|
||||
|
||||
if (controlsMode) {
|
||||
console.log('hello')
|
||||
document.addEventListener('click', this.dialogListener)
|
||||
document.addEventListener('touchend', this.dialogListener)
|
||||
}
|
||||
document.addEventListener('touchstart', this.dialogListener)
|
||||
|
||||
document.self = self
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue