aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views/PanelLeft.vue
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/views/PanelLeft.vue')
-rw-r--r--viewer/src/views/PanelLeft.vue34
1 files changed, 31 insertions, 3 deletions
diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue
index a61fe4a..fd117a6 100644
--- a/viewer/src/views/PanelLeft.vue
+++ b/viewer/src/views/PanelLeft.vue
@@ -19,17 +19,45 @@
19 19
20<template> 20<template>
21 <div class="flex-column sidebar"> 21 <div class="flex-column sidebar">
22 <ld-tag-input /> 22 <ld-tag-input v-model="$uiStore.searchFilters" :tags-index="$galleryStore.tagsIndex" />
23 <ld-command-search @clear="clear" @search="search" />
23 <h1 class="title">{{$t('panelLeft.propositions')}}</h1> 24 <h1 class="title">{{$t('panelLeft.propositions')}}</h1>
24 <ld-proposition class="scrollbar no-scroll-x" /> 25 <ld-proposition
26 v-model="$uiStore.searchFilters"
27 :tags-index="$galleryStore.tagsIndex"
28 :current-tags="currentTags()"
29 class="scrollbar no-scroll-x"
30 />
25 </div> 31 </div>
26</template> 32</template>
27 33
28<script lang="ts"> 34<script lang="ts">
29import { Component, Vue, Prop } from "vue-property-decorator"; 35import { Component, Vue, Prop } from "vue-property-decorator";
36import { Dictionary } from "vue-router/types/router";
30 37
31@Component 38@Component
32export default class PanelLeft extends Vue {} 39export default class PanelLeft extends Vue {
40 clear() {
41 this.$uiStore.searchFilters = [];
42 this.search();
43 }
44
45 search() {
46 this.$router.push({ query: this.serializeSearch() }).catch(err => {
47 if (err.name !== "NavigationDuplicated") throw err;
48 });
49 }
50
51 serializeSearch() {
52 let query: Dictionary<null> = {};
53 this.$uiStore.searchFilters.forEach(filter => (query[filter.display] = null));
54 return query;
55 }
56
57 currentTags() {
58 return this.$galleryStore.currentItem?.tags ?? [];
59 }
60}
33</script> 61</script>
34 62
35<style lang="scss"> 63<style lang="scss">