feat(core): ignore infobox class for table wrapper

This commit is contained in:
alistair3149 2023-05-01 02:37:32 -04:00 committed by GitHub
parent 8bd678a180
commit 81affb88f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,10 +60,15 @@ function setupOverflowState( element ) {
* @return {void}
*/
function wrapTable( table ) {
// Don't do anything if there is a nowrap class
if ( table.classList.contains( 'citizen-table-nowrap' ) ) {
return;
}
const ignoredClasses = [
'citizen-table-nowrap',
'infobox'
];
const hasIgnoredClass = ( ignoreClass ) => table.classList.contains( ignoreClass );
// Return if table has one of the ignored classes
if ( ignoredClasses.some( hasIgnoredClass ) ) return;
const wrapper = document.createElement( 'div' );