mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-12 09:21:11 +00:00
Fire a simluated window resize event when toggling limited width
Bug: T328121 Change-Id: I07695bb359ce849a80e8839744511a6f74a4320f
This commit is contained in:
parent
c4c79b557a
commit
50c8d1631e
|
@ -24,6 +24,16 @@ function init() {
|
|||
toggle.addEventListener( 'click', function () {
|
||||
features.toggle( LIMITED_WIDTH_FEATURE_NAME );
|
||||
setDataAttribute( toggle );
|
||||
// Fire a simulated window resize event (T328121)
|
||||
let event;
|
||||
if ( typeof Event === 'function' ) {
|
||||
event = new Event( 'resize' );
|
||||
} else {
|
||||
// IE11
|
||||
event = window.document.createEvent( 'UIEvents' );
|
||||
event.initUIEvent( 'resize', true, false, window, 0 );
|
||||
}
|
||||
window.dispatchEvent( event );
|
||||
} );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue