aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdCommand.vue
diff options
context:
space:
mode:
authorOzoneGrif2020-02-24 01:15:14 +0100
committerGitHub2020-02-24 01:15:14 +0100
commit2a458e25c0510798120dddbd85cef5ee440c2a2a (patch)
tree77d6958950e1c6a2ad425da1c095fefce58b05e4 /viewer/src/components/LdCommand.vue
parente42f4e864bac21ed3b19d1869df2cdd4f8c3433c (diff)
parenteb00c2a7874608f70ec7768eae8d006a22bc0a54 (diff)
downloadldgallery-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.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}