mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
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 observer = new ResizeObserver(this.onResise.bind(this))
|
||||||
private focused = false
|
private focused = false
|
||||||
private fullscreen = false
|
private fullscreen = false
|
||||||
private activeKeys: any = {}
|
private activeKeys: Set<number> = new Set()
|
||||||
|
|
||||||
get admin() {
|
get admin() {
|
||||||
return this.$accessor.user.admin
|
return this.$accessor.user.admin
|
||||||
@ -409,10 +409,9 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let keys = Object.keys(this.activeKeys)
|
for (let key of this.activeKeys) {
|
||||||
for(let key of keys) {
|
|
||||||
this.$client.sendData('keyup', { key })
|
this.$client.sendData('keyup', { key })
|
||||||
delete this.activeKeys[key]
|
this.activeKeys.delete(key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,7 +502,7 @@
|
|||||||
|
|
||||||
let key = this.getCode(e)
|
let key = this.getCode(e)
|
||||||
this.$client.sendData('keydown', { key })
|
this.$client.sendData('keydown', { key })
|
||||||
this.activeKeys[key] = true
|
this.activeKeys.add(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
onKeyUp(e: KeyboardEvent) {
|
onKeyUp(e: KeyboardEvent) {
|
||||||
@ -513,7 +512,7 @@
|
|||||||
|
|
||||||
let key = this.getCode(e)
|
let key = this.getCode(e)
|
||||||
this.$client.sendData('keyup', { key })
|
this.$client.sendData('keyup', { key })
|
||||||
delete this.activeKeys[key]
|
this.activeKeys.delete(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
onResise() {
|
onResise() {
|
||||||
|
Loading…
Reference in New Issue
Block a user