From 3e0231bfad368d1838d0c55090bbaa0f6a55fef7 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 6 Nov 2022 00:28:32 -0700 Subject: [PATCH] viewer: fix folder share --- src/components/Viewer.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/Viewer.vue b/src/components/Viewer.vue index b3272c2b..1fca297e 100644 --- a/src/components/Viewer.vue +++ b/src/components/Viewer.vue @@ -213,7 +213,7 @@ export default class Viewer extends Mixins(GlobalMixin) { const klass = "has-viewer"; this.photoswipe.on("beforeOpen", () => { document.body.classList.add(klass); - navElem.style.zIndex = "0"; + if (navElem) navElem.style.zIndex = "0"; }); this.photoswipe.on("openingAnimationStart", () => { this.fullyOpened = false; @@ -230,12 +230,9 @@ export default class Viewer extends Mixins(GlobalMixin) { this.opened = false; this.hideSidebar(); }); - this.photoswipe.on("tapAction", () => { - this.opened = !this.opened; // toggle-controls - }); this.photoswipe.on("destroy", () => { document.body.classList.remove(klass); - navElem.style.zIndex = ""; + if (navElem) navElem.style.zIndex = ""; // reset everything this.show = false; @@ -249,6 +246,11 @@ export default class Viewer extends Mixins(GlobalMixin) { this.globalAnchor = -1; }); + // toggle-controls + this.photoswipe.on("tapAction", () => { + this.opened = !this.opened; + }); + // Video support this.photoswipe.on("contentLoad", (e) => { const { content, isLazy } = e;