feat(core): wrap any elements tagged with the class citizen-overflow

This commit is contained in:
alistair3149 2024-05-27 18:01:09 -04:00
parent 7b32aeec7d
commit 4ed68a924d
No known key found for this signature in database

View file

@ -247,13 +247,10 @@ class OverflowElement {
* @return {void} * @return {void}
*/ */
function init( bodyContent ) { function init( bodyContent ) {
// Do not wrap nested tables const overflowElements = bodyContent.querySelectorAll( '.citizen-overflow, table:not( table table )' );
const tables = bodyContent.querySelectorAll( 'table:not( table table )' ); if ( overflowElements.length > 0 ) {
overflowElements.forEach( ( el ) => {
// Wrap tables const overflowElement = new OverflowElement( el );
if ( tables.length > 0 ) {
tables.forEach( ( table ) => {
const overflowElement = new OverflowElement( table );
overflowElement.init(); overflowElement.init();
} ); } );
} }