Skip to content

Commit

Permalink
Fix lightbox initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenchio committed Dec 20, 2024
1 parent 0f1774d commit db205d3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions static/js/lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ window.addEventListener("load", function () {
if (img.parentNode.tagName === "A") {
img.parentNode.setAttribute("data-pswp-width", img.naturalWidth);
img.parentNode.setAttribute("data-pswp-height", img.naturalHeight);

const lightbox = new PhotoSwipeLightbox({
gallery: img.parentNode,
pswpModule: PhotoSwipe
});
lightbox.init();
}
});

const options = {
gallery: '.narrow-container a',
pswpModule: PhotoSwipe
};
const lightbox = new PhotoSwipeLightbox(options);
lightbox.init();
});

0 comments on commit db205d3

Please sign in to comment.