mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-01 02:37:05 +00:00
Merge "DI: Make pinnable elements work on Safari 13 and earlier"
This commit is contained in:
commit
f25eccaac7
|
@ -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.
|
||||||
pinnableBreakpoint.addEventListener( 'change', disablePinningAtBreakpoint.bind( null, header ) );
|
if ( pinnableBreakpoint.addEventListener ) {
|
||||||
|
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