restore calendar attributes

This commit is contained in:
les
2021-01-22 23:07:19 +01:00
parent a6a465d1d0
commit 9c7044bc10

View File

@@ -3,7 +3,7 @@
v-calendar( v-calendar(
title-position='left' title-position='left'
:is-dark="settings['theme.is_dark']" :is-dark="settings['theme.is_dark']"
:columns="2" :columns="$screens({ lg: 2 }, 1)"
@update:from-page='updatePage' @update:from-page='updatePage'
:locale='$i18n.locale' :locale='$i18n.locale'
:attributes='attributes' :attributes='attributes'
@@ -27,15 +27,14 @@ export default {
const month = dayjs().month() + 1 const month = dayjs().month() + 1
const year = dayjs().year() const year = dayjs().year()
return { return {
page: { month, year } page: { month, year },
attributes: []
} }
}, },
computed: { computed: mapState(['tags', 'filters', 'in_past', 'settings']),
...mapState(['tags', 'filters', 'in_past', 'settings']), methods: {
...mapActions(['updateEvents', 'showPastEvents']),
// TODO: could be better updateAttributes () {
attributes () {
return []
const colors = ['blue', 'orange', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray'] const colors = ['blue', 'orange', 'yellow', 'teal', 'indigo', 'green', 'red', 'purple', 'pink', 'gray']
const tags = take(this.tags, 10).map(t => t.tag) const tags = take(this.tags, 10).map(t => t.tag)
let attributes = [] let attributes = []
@@ -69,18 +68,16 @@ export default {
dates: { start: new Date(e.start_datetime * 1000), end: new Date(e.end_datetime * 1000) } dates: { start: new Date(e.start_datetime * 1000), end: new Date(e.end_datetime * 1000) }
}))) })))
return attributes this.attributes = attributes
} },
},
methods: {
...mapActions(['updateEvents', 'showPastEvents']),
updatePage (page) { updatePage (page) {
this.$emit('monthchange', page) return new Promise((resolve, reject) => {
this.$emit('monthchange', page)
this.updateAttributes()
})
}, },
click (day) { click (day) {
this.$emit('dayclick', day) this.$emit('dayclick', day)
// const element = document.getElementById(day.day)
// if (element) { element.scrollIntoView() } // Even IE6 supports this
} }
} }
} }