mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 23:55:53 +00:00
DI: Make pinnable elements work on Safari 13 and earlier
The pinnable element would cause exceptions on older versions of Safari during the setup and the ToC menu would show instead of being pinned and hidden. Bug: T327602 Change-Id: I99b656d0070d3e9af5641274134736b742c28f58
This commit is contained in:
parent
2a65dc2bba
commit
ff830f201e
|
@ -129,7 +129,13 @@ function bindPinnableToggleButtons( header ) {
|
||||||
// Check the breakpoint in case an override is needed on pageload.
|
// Check the breakpoint in case an override is needed on pageload.
|
||||||
disablePinningAtBreakpoint( header, pinnableBreakpoint );
|
disablePinningAtBreakpoint( header, pinnableBreakpoint );
|
||||||
// Add match media handler.
|
// Add match media handler.
|
||||||
|
if ( pinnableBreakpoint.addEventListener ) {
|
||||||
pinnableBreakpoint.addEventListener( 'change', disablePinningAtBreakpoint.bind( null, header ) );
|
pinnableBreakpoint.addEventListener( 'change', disablePinningAtBreakpoint.bind( null, header ) );
|
||||||
|
} else {
|
||||||
|
// Before Safari 14, MediaQueryList is based on EventTarget,
|
||||||
|
// so you must use addListener() and removeListener() to observe media query lists.
|
||||||
|
pinnableBreakpoint.addListener( disablePinningAtBreakpoint.bind( null, header ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue