#27 fix issue with description on lazy loaded images
This commit is contained in:
+1
-9
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user