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