aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views/PanelLeft.vue
diff options
context:
space:
mode:
authorOzoneGrif2020-02-24 01:15:14 +0100
committerGitHub2020-02-24 01:15:14 +0100
commit2a458e25c0510798120dddbd85cef5ee440c2a2a (patch)
tree77d6958950e1c6a2ad425da1c095fefce58b05e4 /viewer/src/views/PanelLeft.vue
parente42f4e864bac21ed3b19d1869df2cdd4f8c3433c (diff)
parenteb00c2a7874608f70ec7768eae8d006a22bc0a54 (diff)
downloadldgallery-2a458e25c0510798120dddbd85cef5ee440c2a2a.tar.gz
Merge pull request #144 from pacien/oz-search-overhaul
viewer: major code and search mode overhaul > Search indicator in the breadcrumbs: should be shown as clickable instead of being .disabled Not agreeing with this one.
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">