Skip to content

Commit

Permalink
fix: album lightbox not working with GIFs
Browse files Browse the repository at this point in the history
also updated simple-lightbox from 2.10.3 to 2.14.2
  • Loading branch information
BobbyWibowo committed Sep 6, 2023
1 parent c905728 commit 8051879
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions public/libs/simple-lightbox/simple-lightbox.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/libs/simple-lightbox/simple-lightbox.min.js

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions src/js/album.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,16 @@ window.addEventListener('DOMContentLoaded', () => {
callback_enter: page.updateImageContainer
})

// Build RegExp out of imageExts array
// SimpleLightbox demands RegExp for configuring supported file extensions
const imageExtsRegex = new RegExp(`${page.lightboxExts.map(ext => {
return ext.substring(1) // removes starting dot
}).join('|')}`, 'i')

page.lightbox = new SimpleLightbox('#table a.image', {
captions: true,
captionSelector: 'img',
captionType: 'attr',
captionsData: 'alt',
captionPosition: 'bottom',
captionDelay: 500,
fileExt: imageExtsRegex,
fileExt: page.lightboxExts.map(ext => {
return ext.substring(1) // removes starting dot
}).join('|'),
preloading: false,
uniqueImages: false
})
Expand Down

0 comments on commit 8051879

Please sign in to comment.