Browse Source

Track way of changing the day

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

Loading…
Cancel
Save