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, 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">
45import { Component, Vue } from "vue-property-decorator"; 37import { Component, Vue, Prop } from "vue-property-decorator";
46import { RawLocation } from "vue-router"; 38import { RawLocation } from "vue-router";
47 39
48@Component 40@Component
49export default class LdCommand extends Vue { 41export 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}