viewer: fix folder share

pull/175/head
Varun Patil 2022-11-06 00:28:32 -07:00
parent ccfa9520dd
commit 3e0231bfad
1 changed files with 7 additions and 5 deletions

View File

@ -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;