fix(core): 🐛 fix incorrect overflow wrapper class name

This commit is contained in:
alistair3149 2024-05-27 16:11:55 -04:00
parent 3cd8d20d1d
commit bc356f915d
No known key found for this signature in database

View file

@ -76,11 +76,11 @@ class OverflowElement {
}
/**
* Wraps the element in a div container with the class 'citizen-table-wrapper'.
* Wraps the element in a div container with the class 'citizen-overflow-wrapper'.
* Checks if the element or its parent node is null or undefined, logs an error if so.
* Verifies the existence of $wgCitizenOverflowNowrapClasses in the config and if it is an array, logs an error if not.
* Skips wrapping if the element contains any of the ignored classes specified in $wgCitizenOverflowNowrapClasses.
* Creates a wrapper div element, adds the class 'citizen-table-wrapper' to it.
* Creates a wrapper div element, adds the class 'citizen-overflow-wrapper' to it.
* Filters and adds inherited classes ('floatleft', 'floatright') from the element to the wrapper.
* Inserts the wrapper before the element in the DOM and appends the element to the wrapper.
* Sets the wrapper element as a property of the class instance.
@ -98,7 +98,7 @@ class OverflowElement {
!config.wgCitizenOverflowNowrapClasses ||
!Array.isArray( config.wgCitizenOverflowNowrapClasses )
) {
mw.log.error( '[Citizen] Invalid or missing $wgCitizenOverflowNowrapClasses. Cannot proceed with wrapping table.' );
mw.log.error( '[Citizen] Invalid or missing $wgCitizenOverflowNowrapClasses. Cannot proceed with wrapping element.' );
return;
}
@ -111,7 +111,7 @@ class OverflowElement {
}
const wrapper = document.createElement( 'div' );
wrapper.className = 'citizen-table-wrapper';
wrapper.className = 'citizen-overflow-wrapper';
const inheritedClasses = [
'floatleft',
@ -221,7 +221,7 @@ class OverflowElement {
/**
* Initializes the process of wrapping overflow elements within the given body content.
*
* @param {HTMLElement} bodyContent - The body content element containing tables to be wrapped.
* @param {HTMLElement} bodyContent - The body content element containing elements to be wrapped.
* @return {void}
*/
function init( bodyContent ) {