Fix errors in lightbox controller
This commit is contained in:
+6
-2
@@ -17,8 +17,12 @@ export default class extends Controller {
|
||||
elements.push(element)
|
||||
} else {
|
||||
this.thumbTargets.forEach(thumb => {
|
||||
let caption = element.hasAttribute('data-lightbox-caption') ? element.dataset.lightboxCaption : null
|
||||
elements.push({ href: thumb.href, title: caption })
|
||||
let element = { href: thumb.href }
|
||||
let caption = this.element.hasAttribute('data-lightbox-caption') ? this.element.dataset.lightboxCaption : null
|
||||
if (null !== caption) {
|
||||
element.title = caption
|
||||
}
|
||||
elements.push(element)
|
||||
})
|
||||
}
|
||||
this.lightbox = Glightbox({
|
||||
|
||||
Reference in New Issue
Block a user