Commit 4f0646e3 authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

FEAT: makes show switch timeslot clicked

parent 3d27674c
......@@ -2,7 +2,25 @@
<b-container>
<b-row v-if="loaded.shows">
<b-col>
<h3>{{ shows[currentShow].name }}</h3>
<b-alert
:show="showChangedAlert.countdown"
@dismiss-count-down="showChangedAlertCountdown"
>
Selected new show: <b>{{ shows[currentShow].name }}</b>
<b-progress
variant="info"
animated
:max="showChangedAlert.seconds"
:value="showChangedAlert.countdown"
height="3px"
/>
</b-alert>
<b-alert
:show="!showChangedAlert.countdown"
variant="light"
>
Currently selected show: <b>{{ shows[currentShow].name }}</b>
</b-alert>
</b-col>
<b-col align="right">
<b-dropdown
......@@ -112,6 +130,11 @@ export default {
timeslots: [],
calendarSlots: [],
showChangedAlert: {
countdown: 0,
seconds: 3
},
// flags for loading data
loaded: {
shows: false,
......@@ -168,6 +191,11 @@ export default {
switchShow (index) {
this.currentShow = index
this.loadCalendarSlots()
this.showChangedAlert.countdown = this.showChangedAlert.seconds
},
showChangedAlertCountdown(countdown) {
this.showChangedAlert.countdown = countdown
},
getShowTitleById (id) {
......@@ -179,6 +207,16 @@ export default {
}
},
getShowIndexById (id) {
let i = this.shows.findIndex(show => show.id === id)
if (i >= 0) {
return i
} else {
this.$log.error('No show found for id ' + id)
return 0
}
},
// this handler will be called whenever the user clicks on one of the
// displayed timeslots
eventSelected (event) {
......@@ -198,9 +236,12 @@ export default {
// currently selected show.
else {
let timeslot = this.timeslots.find(slot => slot.id === event.id)
if (timeslot.show !== this.shows[this.currentShow].id) { return }
if (timeslot.show !== this.shows[this.currentShow].id) {
this.switchShow(this.getShowIndexById(timeslot.show))
} else {
this.$refs.appModalEmissionManagerEdit.open(timeslot, this.shows[this.currentShow])
}
}
},
// currently this will not be called, as our events are not editable
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment