use swipe to switch events

This commit is contained in:
lesion
2022-12-23 01:17:04 +01:00
parent b41c5701ab
commit 0fca21b7d3

View File

@@ -3,7 +3,7 @@ v-container#event.pa-0.pa-sm-2
//- EVENT PAGE
//- gancio supports microformats (http://microformats.org/wiki/h-event)
//- and microdata https://schema.org/Event
v-card.h-event(itemscope itemtype="https://schema.org/Event")
v-card.h-event(itemscope itemtype="https://schema.org/Event" v-touch="{ left: goNext, right: goPrev }")
v-card-text
v-row
@@ -318,12 +318,22 @@ export default {
keyDown (ev) {
if (ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey) { return }
if (ev.key === 'ArrowRight' && this.event.next) {
this.$router.replace(`/event/${this.event.next}`)
this.goNext()
}
if (ev.key === 'ArrowLeft' && this.event.prev) {
this.goPrev()
}
},
goPrev () {
if (this.event.prev) {
this.$router.replace(`/event/${this.event.prev}`)
}
},
goNext () {
if (this.event.next) {
this.$router.replace(`/event/${this.event.next}`)
}
},
showResource (resource) {
this.showResources = true
this.selectedResource = resource