From 0905e3c293ceb0f1d769513870c3931530d6331d Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Mon, 24 Feb 2020 23:24:07 +0100
Subject: viewer: disable the back command to prevent exiting the gallery
GitHub: Resolves #91
---
viewer/src/components/LdCommand.vue | 11 ++++++++++-
viewer/src/views/MainLayout.vue | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
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 @@
-
+
@@ -49,6 +54,10 @@ export default class LdCommand extends Vue {
return this.currentItemPath.length <= 1 && !this.$uiStore.searchMode;
}
+ isEntryPoint(): boolean {
+ return history.state.ldgallery === "ENTRYPOINT"; // Set by MainLayout.vue
+ }
+
parent(): RawLocation {
if (this.$uiStore.searchMode) return this.$route.path;
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 {
scrollPositions: ScrollPosition = {};
mounted() {
+ history.replaceState({ ldgallery: "ENTRYPOINT" }, "");
this.fetchGalleryItems();
}
--
cgit v1.2.3