aboutsummaryrefslogtreecommitdiff
path: root/viewer
diff options
context:
space:
mode:
authorOzoneGrif2020-02-25 01:40:23 +0100
committerGitHub2020-02-25 01:40:23 +0100
commit8c7d95572e8cbc62f03db11b412cb4ccd32a80ce (patch)
tree59f9c9c179907907c016492592aac87c09f81f2e /viewer
parentcfcb8c36ce71bfccdb320e003822497c2b69036f (diff)
parent0905e3c293ceb0f1d769513870c3931530d6331d (diff)
downloadldgallery-8c7d95572e8cbc62f03db11b412cb4ccd32a80ce.tar.gz
Merge pull request #148 from pacien/oz-back-command
viewer: disable the back command to prevent exiting the gallery
Diffstat (limited to 'viewer')
-rw-r--r--viewer/src/components/LdCommand.vue11
-rw-r--r--viewer/src/views/MainLayout.vue1
2 files changed, 11 insertions, 1 deletions
diff --git a/viewer/src/components/LdCommand.vue b/viewer/src/components/LdCommand.vue
index c0b86be..367e08f 100644
--- a/viewer/src/components/LdCommand.vue
+++ b/viewer/src/components/LdCommand.vue
@@ -23,7 +23,12 @@
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 class="link command-secondary" :title="$t('command.back')" @click="$router.go(-1)"> 26 <a
27 :class="{'disabled': isEntryPoint()}"
28 class="link command-secondary"
29 :title="$t('command.back')"
30 @click="isEntryPoint() || $router.back()"
31 >
27 <fa-icon icon="arrow-left" size="lg" /> 32 <fa-icon icon="arrow-left" size="lg" />
28 </a> 33 </a>
29 <router-link :class="{'disabled': isRoot()}" :title="$t('command.parent')" :to="parent()"> 34 <router-link :class="{'disabled': isRoot()}" :title="$t('command.parent')" :to="parent()">
@@ -49,6 +54,10 @@ export default class LdCommand extends Vue {
49 return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode; 54 return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode;
50 } 55 }
51 56
57 isEntryPoint(): boolean {
58 return history.state.ldgallery === "ENTRYPOINT"; // Set by MainLayout.vue
59 }
60
52 parent(): RawLocation { 61 parent(): RawLocation {
53 if (this.$uiStore.searchMode) return this.$route.path; 62 if (this.$uiStore.searchMode) return this.$route.path;
54 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];
diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue
index 272c045..2d74db9 100644
--- a/viewer/src/views/MainLayout.vue
+++ b/viewer/src/views/MainLayout.vue
@@ -43,6 +43,7 @@ export default class MainLayout extends Vue {
43 scrollPositions: ScrollPosition = {}; 43 scrollPositions: ScrollPosition = {};
44 44
45 mounted() { 45 mounted() {
46 history.replaceState({ ldgallery: "ENTRYPOINT" }, "");
46 this.fetchGalleryItems(); 47 this.fetchGalleryItems();
47 } 48 }
48 49