mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-28 09:30:17 +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.
|
||||
disablePinningAtBreakpoint( header, pinnableBreakpoint );
|
||||
// Add match media handler.
|
||||
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