#27 fix issue with description on lazy loaded images

This commit is contained in:
Alan Grainger
2025-05-09 21:47:39 +12:00
parent ea5889f7a6
commit 2bba8d7527
6 changed files with 24 additions and 48 deletions
+1 -9
View File
@@ -64,15 +64,7 @@ class LGallery {
this.items
.slice(this.index, this.index + PER_PAGE)
.forEach(item => {
if (item.video) {
this.element.insertAdjacentHTML('beforeend', `<a data-video='${item.video}'
${item.downloadUrl ? 'data-download-url="' + item.downloadUrl + '"' : ''}>
<img alt="" src="${item.thumbnailUrl}"/><div class="play-icon"></div></a>`)
} else {
this.element.insertAdjacentHTML('beforeend', `<a href="${item.previewUrl}"
${item.downloadUrl ? 'data-download-url="' + item.downloadUrl + '"' : ''}>
<img alt="" src="${item.thumbnailUrl}"/></a>`)
}
this.element.insertAdjacentHTML('beforeend', item)
})
this.index += PER_PAGE
this.lightGallery.refresh()