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) {
|
dialogListener(event) {
|
||||||
console.log(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()
|
event.currentTarget.self.startIntroDialogSequence()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +28,7 @@ class Dialog {
|
||||||
startIntroDialogSequence() {
|
startIntroDialogSequence() {
|
||||||
document.removeEventListener("keydown", this.dialogListener);
|
document.removeEventListener("keydown", this.dialogListener);
|
||||||
document.removeEventListener('click', this.dialogListener)
|
document.removeEventListener('click', this.dialogListener)
|
||||||
document.removeEventListener('touchend', this.dialogListener)
|
document.removeEventListener('touchstart', this.dialogListener)
|
||||||
if (this.currentDialogIndex > this.dialogOrder.length - 1) {
|
if (this.currentDialogIndex > this.dialogOrder.length - 1) {
|
||||||
this.dialogElem.style.display = 'none'
|
this.dialogElem.style.display = 'none'
|
||||||
dialogMode = false
|
dialogMode = false
|
||||||
|
|
@ -53,12 +53,8 @@ class Dialog {
|
||||||
|
|
||||||
var self = this
|
var self = this
|
||||||
document.addEventListener('keydown', this.dialogListener)
|
document.addEventListener('keydown', this.dialogListener)
|
||||||
|
document.addEventListener('click', this.dialogListener)
|
||||||
if (controlsMode) {
|
document.addEventListener('touchstart', this.dialogListener)
|
||||||
console.log('hello')
|
|
||||||
document.addEventListener('click', this.dialogListener)
|
|
||||||
document.addEventListener('touchend', this.dialogListener)
|
|
||||||
}
|
|
||||||
|
|
||||||
document.self = self
|
document.self = self
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue