mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 19:30:36 -06:00
09bb890092
* Chore: reduce strict error in ngReact * Chore: reduce strict errors for ShareModal * Chore: reduce strict errors in VersioHistory * Chore: reduce strict error in ExpressionDatasource * Chore: reduce strict error in DashboardWatcher * Chore: reduce strict error in PluginPage * Chore: reduce strict errors for guard * Chore: update threshold * Chore: reduce strict errors in Graph * Chore: reduce threshold * Apply suggestions from code review Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com> * Chore: reduce strict errors in TimeSeries * Chore: reduce threshold * Chore: reduce strict errors in polyfill * Chore: reduce threshold * Chore: update after PR comments * Update public/app/features/plugins/PluginPage.tsx Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * Update public/app/features/plugins/PluginPage.tsx Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * Chore: changes after PR comments Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
23 lines
611 B
TypeScript
23 lines
611 B
TypeScript
// Safari < 14 does not have mql.addEventListener(), but uses the old spec mql.addListener()
|
|
|
|
let oMatchMedia = window.matchMedia;
|
|
|
|
type MqlListener = (this: MediaQueryList, ev: MediaQueryListEvent) => any;
|
|
|
|
window.matchMedia = (mediaQueryString) => {
|
|
let mql = oMatchMedia(mediaQueryString);
|
|
|
|
if (!mql.addEventListener) {
|
|
// @ts-ignore
|
|
mql.addEventListener = (type: string, listener: MqlListener) => {
|
|
mql.addListener(listener);
|
|
};
|
|
// @ts-ignore
|
|
mql.removeEventListener = (type: string, listener: MqlListener) => {
|
|
mql.removeListener(listener);
|
|
};
|
|
}
|
|
|
|
return mql;
|
|
};
|