diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js index 130c2afe..baa206a7 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js @@ -21,11 +21,10 @@ export default class extends Controller { } const pattern = new RegExp(value, 'i') this.entryTargets.forEach(entry => { - const question = entry.childNodes[0].textContent - const answer = entry.childNodes[1].textContent - if (!question.match(pattern) && !answer.match(pattern)) { - entry.classList.add('hidden') - } + const question = entry.querySelector('button span').textContent + const answer = entry.querySelector('[data-rte-content]').textContent + const matches = question.match(pattern) || answer.match(pattern) + entry.classList.toggle('hidden', !matches) }) } } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Faq.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Faq.html index 29ba758b..5a6b33da 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Faq.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Faq.html @@ -5,7 +5,7 @@
-
+
@@ -28,7 +28,7 @@ data-faq-target="entry">