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