From 28a19ce50476266510f4326d9f532d2a2508d169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 24 Aug 2021 11:21:52 +0200 Subject: [PATCH] Fix errors in lightbox controller --- .../Private/Assets/js/controllers/lightbox_controller.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/lightbox_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/lightbox_controller.js index e228b8ad..1601f634 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/lightbox_controller.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/lightbox_controller.js @@ -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({