mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-15 02:24:04 +00:00
feat(core): ✨ wrap any elements tagged with the class citizen-overflow
This commit is contained in:
parent
7b32aeec7d
commit
4ed68a924d
|
@ -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();
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue