Merge pull request #79 from barzamin/fix-78
components/video.vue: fix keyup-on-blur code
This commit is contained in:
commit
bd1614b320
@ -161,7 +161,7 @@
|
||||
private observer = new ResizeObserver(this.onResise.bind(this))
|
||||
private focused = false
|
||||
private fullscreen = false
|
||||
private activeKeys: any = {}
|
||||
private activeKeys: Set<number> = new Set()
|
||||
|
||||
get admin() {
|
||||
return this.$accessor.user.admin
|
||||
@ -409,10 +409,9 @@
|
||||
return
|
||||
}
|
||||
|
||||
let keys = Object.keys(this.activeKeys)
|
||||
for(let key of keys) {
|
||||
for (let key of this.activeKeys) {
|
||||
this.$client.sendData('keyup', { key })
|
||||
delete this.activeKeys[key]
|
||||
this.activeKeys.delete(key)
|
||||
}
|
||||
}
|
||||
|
||||
@ -503,7 +502,7 @@
|
||||
|
||||
let key = this.getCode(e)
|
||||
this.$client.sendData('keydown', { key })
|
||||
this.activeKeys[key] = true
|
||||
this.activeKeys.add(key)
|
||||
}
|
||||
|
||||
onKeyUp(e: KeyboardEvent) {
|
||||
@ -513,7 +512,7 @@
|
||||
|
||||
let key = this.getCode(e)
|
||||
this.$client.sendData('keyup', { key })
|
||||
delete this.activeKeys[key]
|
||||
this.activeKeys.delete(key)
|
||||
}
|
||||
|
||||
onResise() {
|
||||
|
Reference in New Issue
Block a user