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/components/LdBreadcrumb.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/components/LdBreadcrumb.vue')
-rw-r--r-- | viewer/src/components/LdBreadcrumb.vue | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/viewer/src/components/LdBreadcrumb.vue b/viewer/src/components/LdBreadcrumb.vue index 7f7ef7d..643bfb6 100644 --- a/viewer/src/components/LdBreadcrumb.vue +++ b/viewer/src/components/LdBreadcrumb.vue | |||
@@ -29,24 +29,29 @@ | |||
29 | > | 29 | > |
30 | <div v-show="overflowMask" class="ld-breadcrumb-overflow-mask"></div> | 30 | <div v-show="overflowMask" class="ld-breadcrumb-overflow-mask"></div> |
31 | <ul class="ld-breadcrumb"> | 31 | <ul class="ld-breadcrumb"> |
32 | <li v-for="(item,idx) in $galleryStore.currentItemPath" :key="item.path"> | 32 | <li v-for="(item,idx) in currentItemPath" :key="item.path"> |
33 | <fa-icon v-if="idx > 0" icon="angle-right" class="disabled" /> | 33 | <fa-icon v-if="idx > 0" icon="angle-right" class="disabled" /> |
34 | <router-link :to="item.path" class="link"> | 34 | <router-link :to="item.path" class="link"> |
35 | <fa-icon :icon="getIcon(item)" size="lg" /> | 35 | <fa-icon :icon="getIcon(item)" size="lg" /> |
36 | {{item.title}} | 36 | {{item.title}} |
37 | </router-link> | 37 | </router-link> |
38 | </li> | 38 | </li> |
39 | <li v-if="searchMode"> | ||
40 | <fa-icon icon="search" size="lg" class="disabled" /> | ||
41 | </li> | ||
39 | </ul> | 42 | </ul> |
40 | </div> | 43 | </div> |
41 | </template> | 44 | </template> |
42 | 45 | ||
43 | <script lang="ts"> | 46 | <script lang="ts"> |
44 | import { Component, Vue, Ref, Watch } from "vue-property-decorator"; | 47 | import { Component, Vue, Ref, Watch, Prop } from "vue-property-decorator"; |
45 | import DragScrollClickFix from "@/dragscrollclickfix"; | 48 | import DragScrollClickFix from "@/services/dragscrollclickfix"; |
46 | import Tools from "@/tools"; | 49 | import Navigation from "@/services/navigation"; |
47 | 50 | ||
48 | @Component | 51 | @Component |
49 | export default class LdBreadcrumb extends Vue { | 52 | export default class LdBreadcrumb extends Vue { |
53 | @Prop({ required: true }) readonly currentItemPath!: Gallery.Item[]; | ||
54 | @Prop(Boolean) readonly searchMode!: boolean; | ||
50 | @Ref() readonly breadcrumb!: HTMLUListElement; | 55 | @Ref() readonly breadcrumb!: HTMLUListElement; |
51 | 56 | ||
52 | readonly dragScrollClickFix = new DragScrollClickFix(); | 57 | readonly dragScrollClickFix = new DragScrollClickFix(); |
@@ -66,7 +71,7 @@ export default class LdBreadcrumb extends Vue { | |||
66 | this.overflowMask = this.breadcrumb.scrollLeft > 1; | 71 | this.overflowMask = this.breadcrumb.scrollLeft > 1; |
67 | } | 72 | } |
68 | 73 | ||
69 | @Watch("$galleryStore.currentItemPath") | 74 | @Watch("currentItemPath") |
70 | changedCurrentItemPath() { | 75 | changedCurrentItemPath() { |
71 | this.$nextTick(() => { | 76 | this.$nextTick(() => { |
72 | this.breadcrumb.scrollLeft = this.breadcrumb.scrollWidth; | 77 | this.breadcrumb.scrollLeft = this.breadcrumb.scrollWidth; |
@@ -75,7 +80,7 @@ export default class LdBreadcrumb extends Vue { | |||
75 | } | 80 | } |
76 | 81 | ||
77 | getIcon(item: Gallery.Item) { | 82 | getIcon(item: Gallery.Item) { |
78 | return Tools.getIcon(item); | 83 | return Navigation.getIcon(item); |
79 | } | 84 | } |
80 | } | 85 | } |
81 | </script> | 86 | </script> |