Commit 1336f087 authored by webchick's avatar webchick
Browse files

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

parent 3b4548f9
......@@ -72,8 +72,12 @@ window.matchMedia = window.matchMedia || (function (doc, window) {
addListener: function (callback) {
var handler = (function (mql, debounced) {
return function () {
// Only execute the callback if the state has changed.
var oldstate = mql.matches;
mql.check();
debounced.call(mql, mql);
if (oldstate != mql.matches) {
debounced.call(mql, mql);
}
};
}(this, debounce(callback, 250)));
this.listeners.push({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment