From 619998b2f3cd3713965b15d6365ff66c4277b308 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Tue, 22 Dec 2020 19:16:09 +0100 Subject: [PATCH] fix(gallery): check also that PhotoSwipeUI_Default is loaded --- assets/ts/gallery.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/ts/gallery.ts b/assets/ts/gallery.ts index 208194f..2e1063b 100644 --- a/assets/ts/gallery.ts +++ b/assets/ts/gallery.ts @@ -21,11 +21,11 @@ class StackGallery { private items: PhotoSwipeItem[] = []; constructor(container: HTMLElement, galleryUID = 1) { - if (window.PhotoSwipe == undefined) { + if (window.PhotoSwipe == undefined || window.PhotoSwipeUI_Default == undefined) { console.error("PhotoSwipe lib not loaded."); return; } - + this.galleryUID = galleryUID; StackGallery.createGallery(container);