mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
fix toggle show recurrent
This commit is contained in:
parent
f6ced324b6
commit
2f295571de
1 changed files with 15 additions and 12 deletions
|
@ -2,12 +2,10 @@
|
||||||
v-container.pt-0.pt-md-2
|
v-container.pt-0.pt-md-2
|
||||||
v-switch.mt-0(
|
v-switch.mt-0(
|
||||||
v-if='recurrentFilter && settings.allow_recurrent_event'
|
v-if='recurrentFilter && settings.allow_recurrent_event'
|
||||||
:value='filters.show_recurrent'
|
v-model='showRecurrent'
|
||||||
inset color='primary'
|
inset color='primary'
|
||||||
hide-details
|
hide-details
|
||||||
:label="$t('event.show_recurrent')"
|
:label="$t('event.show_recurrent')")
|
||||||
@change="toggleShowRecurrent")
|
|
||||||
|
|
||||||
v-autocomplete.mt-0(
|
v-autocomplete.mt-0(
|
||||||
:label='$t("common.search")'
|
:label='$t("common.search")'
|
||||||
:items='keywords'
|
:items='keywords'
|
||||||
|
@ -51,6 +49,19 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['tags', 'places', 'settings']),
|
...mapState(['tags', 'places', 'settings']),
|
||||||
|
showRecurrent: {
|
||||||
|
get () {
|
||||||
|
return this.filters.show_recurrent
|
||||||
|
},
|
||||||
|
set (v) {
|
||||||
|
const filters = {
|
||||||
|
tags: this.filters.tags,
|
||||||
|
places: this.filters.places,
|
||||||
|
show_recurrent: v
|
||||||
|
}
|
||||||
|
this.$emit('update', filters)
|
||||||
|
}
|
||||||
|
},
|
||||||
selectedFilters () {
|
selectedFilters () {
|
||||||
const tags = this.tags.filter(t => this.filters.tags.includes(t.tag)).map(t => ({ type: 'tag', label: t.tag, weigth: t.weigth, id: t.tag }))
|
const tags = this.tags.filter(t => this.filters.tags.includes(t.tag)).map(t => ({ type: 'tag', label: t.tag, weigth: t.weigth, id: t.tag }))
|
||||||
const places = this.places.filter(p => this.filters.places.includes(p.id))
|
const places = this.places.filter(p => this.filters.places.includes(p.id))
|
||||||
|
@ -74,14 +85,6 @@ export default {
|
||||||
}
|
}
|
||||||
this.$emit('update', filters)
|
this.$emit('update', filters)
|
||||||
},
|
},
|
||||||
toggleShowRecurrent (v) {
|
|
||||||
const filters = {
|
|
||||||
tags: this.filters.tags,
|
|
||||||
places: this.filters.places,
|
|
||||||
show_recurrent: v
|
|
||||||
}
|
|
||||||
this.$emit('update', filters)
|
|
||||||
},
|
|
||||||
change (filters) {
|
change (filters) {
|
||||||
filters = {
|
filters = {
|
||||||
tags: filters.filter(t => t.type === 'tag').map(t => t.id),
|
tags: filters.filter(t => t.type === 'tag').map(t => t.id),
|
||||||
|
|
Loading…
Reference in a new issue