diff options
author | OzoneGrif | 2020-02-24 01:15:14 +0100 |
---|---|---|
committer | GitHub | 2020-02-24 01:15:14 +0100 |
commit | 2a458e25c0510798120dddbd85cef5ee440c2a2a (patch) | |
tree | 77d6958950e1c6a2ad425da1c095fefce58b05e4 /viewer/src/components/LdCommand.vue | |
parent | e42f4e864bac21ed3b19d1869df2cdd4f8c3433c (diff) | |
parent | eb00c2a7874608f70ec7768eae8d006a22bc0a54 (diff) | |
download | ldgallery-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/components/LdCommand.vue')
-rw-r--r-- | viewer/src/components/LdCommand.vue | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue index 7590ea7..c0b86be 100644 --- a/viewer/src/components/LdCommand.vue +++ b/viewer/src/components/LdCommand.vue | |||
@@ -23,14 +23,6 @@ | |||
23 | <a class="link" :title="$t('command.search')" @click="$uiStore.toggleFullWidth()"> | 23 | <a class="link" :title="$t('command.search')" @click="$uiStore.toggleFullWidth()"> |
24 | <fa-icon :icon="commandToggleSearchPanelIcon()" size="lg" /> | 24 | <fa-icon :icon="commandToggleSearchPanelIcon()" size="lg" /> |
25 | </a> | 25 | </a> |
26 | <router-link | ||
27 | to="/" | ||
28 | class="command-secondary" | ||
29 | :class="{'disabled': isRoot()}" | ||
30 | :title="$t('command.home')" | ||
31 | > | ||
32 | <fa-icon icon="home" size="lg" /> | ||
33 | </router-link> | ||
34 | <a class="link command-secondary" :title="$t('command.back')" @click="$router.go(-1)"> | 26 | <a class="link command-secondary" :title="$t('command.back')" @click="$router.go(-1)"> |
35 | <fa-icon icon="arrow-left" size="lg" /> | 27 | <fa-icon icon="arrow-left" size="lg" /> |
36 | </a> | 28 | </a> |
@@ -42,21 +34,24 @@ | |||
42 | </template> | 34 | </template> |
43 | 35 | ||
44 | <script lang="ts"> | 36 | <script lang="ts"> |
45 | import { Component, Vue } from "vue-property-decorator"; | 37 | import { Component, Vue, Prop } from "vue-property-decorator"; |
46 | import { RawLocation } from "vue-router"; | 38 | import { RawLocation } from "vue-router"; |
47 | 39 | ||
48 | @Component | 40 | @Component |
49 | export default class LdCommand extends Vue { | 41 | export default class LdCommand extends Vue { |
42 | @Prop({ required: true }) readonly currentItemPath!: Gallery.Item[]; | ||
43 | |||
50 | commandToggleSearchPanelIcon(): string { | 44 | commandToggleSearchPanelIcon(): string { |
51 | return this.$uiStore.fullWidth ? "search" : "angle-double-left"; | 45 | return this.$uiStore.fullWidth ? "search" : "angle-double-left"; |
52 | } | 46 | } |
53 | 47 | ||
54 | isRoot(): boolean { | 48 | isRoot(): boolean { |
55 | return this.$galleryStore.currentItemPath.length <= 1; | 49 | return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode; |
56 | } | 50 | } |
57 | 51 | ||
58 | parent(): RawLocation { | 52 | parent(): RawLocation { |
59 | if (!this.isRoot()) return this.$galleryStore.currentItemPath[this.$galleryStore.currentItemPath.length - 2]; | 53 | if (this.$uiStore.searchMode) return this.$route.path; |
54 | if (this.currentItemPath.length > 1) return this.currentItemPath[this.currentItemPath.length - 2]; | ||
60 | return ""; | 55 | return ""; |
61 | } | 56 | } |
62 | } | 57 | } |