diff options
author | Zero~Informatique | 2020-02-14 09:19:53 +0100 |
---|---|---|
committer | Zero~Informatique | 2020-02-24 00:04:39 +0100 |
commit | 370e3db3455f548699ff5e046e0f8dcc304991ac (patch) | |
tree | e29fe9e2afb940eea74c8ed510c46a1eb0fa4d84 /viewer/src/views/PanelLeft.vue | |
parent | e42f4e864bac21ed3b19d1869df2cdd4f8c3433c (diff) | |
download | ldgallery-370e3db3455f548699ff5e046e0f8dcc304991ac.tar.gz |
viewer: major code and search mode overhaul
Updated libraries to the lastest version
SCSS Formatter as suggested VSC extensions
Renamed toolbar-color by scrollbar-color
LD components use Props in favor of touching the stores directly (when possible)
Moved most common algorithms to a "services" folder
Complete search overhaul (lots of code change)
Diffstat (limited to 'viewer/src/views/PanelLeft.vue')
-rw-r--r-- | viewer/src/views/PanelLeft.vue | 34 |
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"> |
29 | import { Component, Vue, Prop } from "vue-property-decorator"; | 35 | import { Component, Vue, Prop } from "vue-property-decorator"; |
36 | import { Dictionary } from "vue-router/types/router"; | ||
30 | 37 | ||
31 | @Component | 38 | @Component |
32 | export default class PanelLeft extends Vue {} | 39 | export 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"> |