Emit a window resize event when client preferences are changed

Bug: T374092
Change-Id: Ie0a9382498c682ac8c1f7942cc3590e9789a1e80
This commit is contained in:
Ed Sanders 2024-09-05 11:26:43 +01:00
parent b3300f6f19
commit f653d50f12

View file

@ -68,6 +68,7 @@ function toggleDocClassAndSave( featureName, value, config, userPreferences ) {
document.documentElement.classList.remove( `${ featureName }-clientpref-${ possibleValue }` );
} );
document.documentElement.classList.add( `${ featureName }-clientpref-${ value }` );
window.dispatchEvent( new Event( 'resize' ) );
// Ideally this should be taken care of via a single core helper function.
mw.util.debounce( () => {
userPreferences = userPreferences || new mw.Api();