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.vue36
1 files changed, 33 insertions, 3 deletions
diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue
index a61fe4a..6292e78 100644
--- a/viewer/src/views/PanelLeft.vue
+++ b/viewer/src/views/PanelLeft.vue
@@ -19,17 +19,47 @@
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";
37import Navigation from "@/services/navigation";
30 38
31@Component 39@Component
32export default class PanelLeft extends Vue {} 40export default class PanelLeft extends Vue {
41 clear() {
42 this.$uiStore.searchFilters = [];
43 this.search();
44 }
45
46 search() {
47 const lastDirectory = Navigation.getLastDirectory(this.$galleryStore.currentItemPath);
48 this.$router.push({ path: lastDirectory.path, query: this.serializeSearch() }).catch(err => {
49 if (err.name !== "NavigationDuplicated") throw err;
50 });
51 }
52
53 serializeSearch() {
54 let query: Dictionary<null> = {};
55 this.$uiStore.searchFilters.forEach(filter => (query[filter.display] = null));
56 return query;
57 }
58
59 currentTags() {
60 return this.$galleryStore.currentItem?.tags ?? [];
61 }
62}
33</script> 63</script>
34 64
35<style lang="scss"> 65<style lang="scss">