From 2b9486b1af2a0b26ae489ba7814476342cb82f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 23 Aug 2021 21:06:22 +0200 Subject: [PATCH] Fix lightbox not showing iframe content --- .../Assets/js/controllers/lightbox_controller.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 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 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 - } }