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 5c9ba393..e228b8ad 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 @@ -10,16 +10,14 @@ export default class extends Controller { connect() { let elements = [] if (this.hasUrlValue) { - let caption = this.getCaption(this.element) - let element = { href: this.urlValue, title: caption } + let element = { href: this.urlValue } elements.push(element) } else if (this.element.hasAttribute('href')) { - let caption = this.getCaption(this.element) - let element = { href: this.element.href, title: caption } + let element = { href: this.element.href } elements.push(element) } else { this.thumbTargets.forEach(thumb => { - let caption = this.getCaption(thumb) + let caption = element.hasAttribute('data-lightbox-caption') ? element.dataset.lightboxCaption : null elements.push({ href: thumb.href, title: caption }) }) } @@ -36,8 +34,4 @@ export default class extends Controller { } this.lightbox.openAt(index - 1) } - - getCaption(element) { - return element.hasAttribute('data-lightbox-caption') ? element.dataset.lightboxCaption : null - } }