Browse Source

Track way of changing the day

master
Schneider 6 years ago
parent
commit
7cc395e055
  1. 19
      src/App.vue

19
src/App.vue

@ -10,8 +10,8 @@
<option v-for="day in days" :value="day" :key="day">{{dayOfWeek[day]}}</option>
</select>
<v-touch
v-on:swipeleft="nextDay"
v-on:swiperight="previousDay"
v-on:swipeleft="swipePrevious"
v-on:swiperight="swipeNext"
v-bind:swipe-options="{ direction: 'horizontal' }">
<router-view></router-view>
</v-touch>
@ -50,6 +50,14 @@ export default {
}
},
methods: {
swipeNext() {
window._paq.push(['trackEvent', 'Navigation', 'NextDay', 'swipe'])
this.nextDay()
},
swipePrevious() {
window._paq.push(['trackEvent', 'Navigation', 'PreviousDay', 'swipe'])
this.previousDay()
},
previousDay() {
this.when === 1 ? (this.when = 6) : this.when--
},
@ -98,12 +106,19 @@ export default {
case 37:
if (vm.selWhen !== document.activeElement) {
// increment only if selection is not focused, avoid double execution
window._paq.push([
'trackEvent',
'Navigation',
'PreviousDay',
'arrow'
])
vm.previousDay()
}
break
case 39:
if (vm.selWhen !== document.activeElement) {
// increment only if selection is not focused, avoid double execution
window._paq.push(['trackEvent', 'Navigation', 'NextDay', 'arrow'])
vm.nextDay()
break
}

Loading…
Cancel
Save