Trigger window.resize when toggeling pinnableElement

The width of the screen changes when the pinnableElement is pinned
or un-pinned. Other features may need to react to this, like for
example the RevisionSlider extension.

Triggering a window.resize is a generic way to make sure these
changes can be handled by other elements on the page.

Bug: T336729
Depends-On: Iba22924b660f2709c0680aa6fbeb0feba92cfa76
Change-Id: I49878fdd8794273919bf961648fd93fdcf9511af
This commit is contained in:
WMDE-Fisch 2023-10-18 13:08:59 +02:00 committed by Thiemo Kreuz (WMDE)
parent ce5c5dba93
commit 7e63cdb219

View file

@ -112,6 +112,7 @@ function pinnableElementClickHandler( header ) {
setSavedPinnableState( header );
const newContainerId = isPinnedElement ? pinnedContainerId : unpinnedContainerId;
movePinnableElement( pinnableElementId, newContainerId );
window.dispatchEvent( new Event( 'resize' ) );
setFocusAfterToggle( pinnableElementId );
if ( !isPinnedElement ) {
addPinnableElementIndicator( pinnableElementId );