mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
left/right keys goes to prev/next event
This commit is contained in:
parent
9854c7ad97
commit
539c0fa933
1 changed files with 14 additions and 0 deletions
|
@ -249,7 +249,21 @@ export default {
|
|||
)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
window.addEventListener('keydown', this.keyDown)
|
||||
},
|
||||
destroyed () {
|
||||
window.removeEventListener('keydown', this.keyDown)
|
||||
},
|
||||
methods: {
|
||||
keyDown (ev) {
|
||||
if (ev.key === 'ArrowRight' && this.event.next) {
|
||||
this.$router.push(`/event/${this.event.next}`)
|
||||
}
|
||||
if (ev.key === 'ArrowLeft' && this.event.prev) {
|
||||
this.$router.push(`/event/${this.event.prev}`)
|
||||
}
|
||||
},
|
||||
showResource (resource) {
|
||||
this.showResources = true
|
||||
this.selectedResource = resource
|
||||
|
|
Loading…
Reference in a new issue