diff options
Diffstat (limited to 'viewer/src/components/LdCommand.vue')
-rw-r--r-- | viewer/src/components/LdCommand.vue | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue index d961519..49d86bb 100644 --- a/viewer/src/components/LdCommand.vue +++ b/viewer/src/components/LdCommand.vue | |||
@@ -21,17 +21,17 @@ | |||
21 | <template> | 21 | <template> |
22 | <div class="flex command-btns"> | 22 | <div class="flex command-btns"> |
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 | <a | 26 | <a |
27 | :class="{'disabled': isEntryPoint()}" | 27 | :class="{'disabled': isEntryPoint}" |
28 | class="link command-secondary" | 28 | class="link command-secondary" |
29 | :title="$t('command.back')" | 29 | :title="$t('command.back')" |
30 | @click="isEntryPoint() || $router.back()" | 30 | @click="isEntryPoint || $router.back()" |
31 | > | 31 | > |
32 | <fa-icon icon="arrow-left" size="lg" /> | 32 | <fa-icon icon="arrow-left" size="lg" /> |
33 | </a> | 33 | </a> |
34 | <router-link :class="{'disabled': isRoot()}" :title="$t('command.parent')" :to="parent()"> | 34 | <router-link :class="{'disabled': isRoot}" :title="$t('command.parent')" :to="parent"> |
35 | <fa-icon icon="folder" size="xs" /> | 35 | <fa-icon icon="folder" size="xs" /> |
36 | <fa-icon icon="level-up-alt" size="lg" /> | 36 | <fa-icon icon="level-up-alt" size="lg" /> |
37 | </router-link> | 37 | </router-link> |
@@ -46,19 +46,19 @@ import { RawLocation } from "vue-router"; | |||
46 | export default class LdCommand extends Vue { | 46 | export default class LdCommand extends Vue { |
47 | @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[]; | 47 | @Prop({ type: Array, required: true }) readonly currentItemPath!: Gallery.Item[]; |
48 | 48 | ||
49 | commandToggleSearchPanelIcon(): string { | 49 | get commandToggleSearchPanelIcon(): string { |
50 | return this.$uiStore.fullWidth ? "search" : "angle-double-left"; | 50 | return this.$uiStore.fullWidth ? "search" : "angle-double-left"; |
51 | } | 51 | } |
52 | 52 | ||
53 | isRoot(): boolean { | 53 | get isRoot(): boolean { |
54 | return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode; | 54 | return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode; |
55 | } | 55 | } |
56 | 56 | ||
57 | isEntryPoint(): boolean { | 57 | get isEntryPoint(): boolean { |
58 | return history.state?.ldgallery === "ENTRYPOINT"; // Set by MainLayout.vue | 58 | return history.state?.ldgallery === "ENTRYPOINT"; // Set by MainLayout.vue |
59 | } | 59 | } |
60 | 60 | ||
61 | parent(): RawLocation { | 61 | get parent(): RawLocation { |
62 | if (this.$uiStore.searchMode) return this.$route.path; | 62 | if (this.$uiStore.searchMode) return this.$route.path; |
63 | if (this.currentItemPath.length > 1) return this.currentItemPath[this.currentItemPath.length - 2]; | 63 | if (this.currentItemPath.length > 1) return this.currentItemPath[this.currentItemPath.length - 2]; |
64 | return ""; | 64 | return ""; |