use swipe to switch events
This commit is contained in:
@@ -3,7 +3,7 @@ v-container#event.pa-0.pa-sm-2
|
|||||||
//- EVENT PAGE
|
//- EVENT PAGE
|
||||||
//- gancio supports microformats (http://microformats.org/wiki/h-event)
|
//- gancio supports microformats (http://microformats.org/wiki/h-event)
|
||||||
//- and microdata https://schema.org/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-card-text
|
||||||
v-row
|
v-row
|
||||||
@@ -318,12 +318,22 @@ export default {
|
|||||||
keyDown (ev) {
|
keyDown (ev) {
|
||||||
if (ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey) { return }
|
if (ev.altKey || ev.ctrlKey || ev.metaKey || ev.shiftKey) { return }
|
||||||
if (ev.key === 'ArrowRight' && this.event.next) {
|
if (ev.key === 'ArrowRight' && this.event.next) {
|
||||||
this.$router.replace(`/event/${this.event.next}`)
|
this.goNext()
|
||||||
}
|
}
|
||||||
if (ev.key === 'ArrowLeft' && this.event.prev) {
|
if (ev.key === 'ArrowLeft' && this.event.prev) {
|
||||||
|
this.goPrev()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
goPrev () {
|
||||||
|
if (this.event.prev) {
|
||||||
this.$router.replace(`/event/${this.event.prev}`)
|
this.$router.replace(`/event/${this.event.prev}`)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
goNext () {
|
||||||
|
if (this.event.next) {
|
||||||
|
this.$router.replace(`/event/${this.event.next}`)
|
||||||
|
}
|
||||||
|
},
|
||||||
showResource (resource) {
|
showResource (resource) {
|
||||||
this.showResources = true
|
this.showResources = true
|
||||||
this.selectedResource = resource
|
this.selectedResource = resource
|
||||||
|
|||||||
Reference in New Issue
Block a user