Skip to content

Commit

Permalink
feat: add pop-up on event click
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonVreling committed Apr 17, 2020
1 parent 31f7ed1 commit 29de365
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/views/dashboard/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ export default {
this.fetchEvents()
},
eventClick (info) {
console.log(info.event.extendedProps.description)
info.jsEvent.preventDefault(); // don't let the browser navigate
if (info.event.url) {
window.open(info.event.url)
} else {
this.$buefy.dialog.alert({
title: info.event.title,
message: info.event.extendedProps.description,
canCancel: '[escape, outside]'
})
}
},
fetchEvents () {
this.isLoading = true
Expand Down Expand Up @@ -118,6 +128,7 @@ export default {
/* Loading the online events Google calendar */
const onlineEventsData = Object.values(ical.parseICS(result))
onlineEventsData.shift() // remove the timezone object. Alternative: drop object where "onlineEventsData.type != 'VEVENT'"
console.log(onlineEventsData)
return onlineEventsData.map((event) => ({
title: event.summary,
start: new Date(event.start),
Expand Down

0 comments on commit 29de365

Please sign in to comment.