mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
fix(gallery): check also that PhotoSwipeUI_Default is loaded
This commit is contained in:
parent
9acba47e08
commit
619998b2f3
@ -21,11 +21,11 @@ class StackGallery {
|
|||||||
private items: PhotoSwipeItem[] = [];
|
private items: PhotoSwipeItem[] = [];
|
||||||
|
|
||||||
constructor(container: HTMLElement, galleryUID = 1) {
|
constructor(container: HTMLElement, galleryUID = 1) {
|
||||||
if (window.PhotoSwipe == undefined) {
|
if (window.PhotoSwipe == undefined || window.PhotoSwipeUI_Default == undefined) {
|
||||||
console.error("PhotoSwipe lib not loaded.");
|
console.error("PhotoSwipe lib not loaded.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.galleryUID = galleryUID;
|
this.galleryUID = galleryUID;
|
||||||
|
|
||||||
StackGallery.createGallery(container);
|
StackGallery.createGallery(container);
|
||||||
|
Loading…
Reference in New Issue
Block a user