From 4ed68a924d54a40716933a77736be84485f69c7c Mon Sep 17 00:00:00 2001 From: alistair3149 Date: Mon, 27 May 2024 18:01:09 -0400 Subject: [PATCH] =?UTF-8?q?feat(core):=20=E2=9C=A8=20wrap=20any=20elements?= =?UTF-8?q?=20tagged=20with=20the=20class=20citizen-overflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/skins.citizen.scripts/overflowElements.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/resources/skins.citizen.scripts/overflowElements.js b/resources/skins.citizen.scripts/overflowElements.js index 7383328e..f0887510 100644 --- a/resources/skins.citizen.scripts/overflowElements.js +++ b/resources/skins.citizen.scripts/overflowElements.js @@ -247,13 +247,10 @@ class OverflowElement { * @return {void} */ function init( bodyContent ) { - // Do not wrap nested tables - const tables = bodyContent.querySelectorAll( 'table:not( table table )' ); - - // Wrap tables - if ( tables.length > 0 ) { - tables.forEach( ( table ) => { - const overflowElement = new OverflowElement( table ); + const overflowElements = bodyContent.querySelectorAll( '.citizen-overflow, table:not( table table )' ); + if ( overflowElements.length > 0 ) { + overflowElements.forEach( ( el ) => { + const overflowElement = new OverflowElement( el ); overflowElement.init(); } ); }