From e98da29a1447cb932abd4c316d2a81a3adecf9e9 Mon Sep 17 00:00:00 2001 From: jane-taleika Date: Mon, 3 Jul 2023 13:51:26 +0200 Subject: [PATCH 1/2] add console for powerbi inside accordion --- modules/quanthub_core/js/qh_core-power-bi-customizer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/quanthub_core/js/qh_core-power-bi-customizer.js b/modules/quanthub_core/js/qh_core-power-bi-customizer.js index 9c7d389..a34d4ff 100644 --- a/modules/quanthub_core/js/qh_core-power-bi-customizer.js +++ b/modules/quanthub_core/js/qh_core-power-bi-customizer.js @@ -40,6 +40,9 @@ function updateToken($, context) { function powerbi_embed_customizeReport($, context, width = 0, height = 0, title = '', name = '') { const iframes = $(`#${context.selector} iframe`); for (let i = 0; i < iframes.length; i++) { + if ($(iframes[i]).parents().hasClass('ckeditor-accordion-container')){ + console.log('powerBi is inside ckeditor-accordion-container!') + } iframes[i].frameBorder = 0; if (iframes[i].attributes.getNamedItem('style')) { iframes[i].attributes.removeNamedItem('style'); From 87674e576e55296e5cae821fde6d3ec1d18ee2ba Mon Sep 17 00:00:00 2001 From: jane-taleika Date: Mon, 3 Jul 2023 14:22:24 +0200 Subject: [PATCH 2/2] add click handler --- .../quanthub_core/js/qh_core-power-bi-customizer.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/quanthub_core/js/qh_core-power-bi-customizer.js b/modules/quanthub_core/js/qh_core-power-bi-customizer.js index a34d4ff..dc7e367 100644 --- a/modules/quanthub_core/js/qh_core-power-bi-customizer.js +++ b/modules/quanthub_core/js/qh_core-power-bi-customizer.js @@ -41,7 +41,18 @@ function powerbi_embed_customizeReport($, context, width = 0, height = 0, title const iframes = $(`#${context.selector} iframe`); for (let i = 0; i < iframes.length; i++) { if ($(iframes[i]).parents().hasClass('ckeditor-accordion-container')){ - console.log('powerBi is inside ckeditor-accordion-container!') + const togglers = $(iframes[i]).parents().find('.ckeditor-accordion-toggler'); + togglers.each((i)=>{ + $(togglers[i]).off('click'); + $(togglers[i]).on('click', function(e){ + let $title = this.parentNode; + if ($title.classList.contains('active')) { + //probably will need timeout for animation + console.log('powerBi is inside ckeditor-accordion-container!'); + } + }); + }) + } iframes[i].frameBorder = 0; if (iframes[i].attributes.getNamedItem('style')) {