Skip to content
Snippets Groups Projects
Commit 1336f087 authored by Angie Byron's avatar Angie Byron
Browse files

Issue follow-up #1815602 by attiks: Polyfill tweak for IE.

parent 3b4548f9
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -72,8 +72,12 @@ window.matchMedia = window.matchMedia || (function (doc, window) { ...@@ -72,8 +72,12 @@ window.matchMedia = window.matchMedia || (function (doc, window) {
addListener: function (callback) { addListener: function (callback) {
var handler = (function (mql, debounced) { var handler = (function (mql, debounced) {
return function () { return function () {
// Only execute the callback if the state has changed.
var oldstate = mql.matches;
mql.check(); mql.check();
if (oldstate != mql.matches) {
debounced.call(mql, mql); debounced.call(mql, mql);
}
}; };
}(this, debounce(callback, 250))); }(this, debounce(callback, 250)));
this.listeners.push({ this.listeners.push({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment