Merge pull request #2244 from nextcloud/enh/filter-on-label-click

Toggle filter on clicking card labels
This commit is contained in:
Julius Härtl
2020-08-31 11:30:31 +02:00
committed by GitHub
2 changed files with 27 additions and 3 deletions

View File

@@ -57,7 +57,7 @@
class="labels"
@click="openCard">
<li v-for="label in card.labels" :key="label.id" :style="labelStyle(label)">
<span>{{ label.title }}</span>
<span @click="applyLabelFilter(label)">{{ label.title }}</span>
</li>
</transition-group>
<div v-show="!compactMode" class="card-controls compact-item" @click="openCard">
@@ -142,6 +142,9 @@ export default {
cancelEdit() {
this.editing = false
},
applyLabelFilter(label) {
this.$nextTick(() => this.$store.dispatch('toggleFilter', { tags: [label.id] }))
},
},
}
</script>