Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set matchMedia on window to fix issue on IE11, fixes #11358 #11393

Merged
merged 2 commits into from Jul 11, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions js/foundation.util.mediaQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const defaultQueries = {

// matchMedia() polyfill - Test a CSS media type/query in JS.
// Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license
let matchMedia = window.matchMedia || (function() {
window.matchMedia = window.matchMedia || (function() {
'use strict';

// For browsers that support matchMedium api such as IE 9 and webkit
Expand Down Expand Up @@ -109,7 +109,7 @@ var MediaQuery = {
var query = this.get(size);

if (query) {
return matchMedia(query).matches;
return window.matchMedia(query).matches;
}

return false;
Expand Down Expand Up @@ -160,7 +160,7 @@ var MediaQuery = {
for (var i = 0; i < this.queries.length; i++) {
var query = this.queries[i];

if (matchMedia(query.value).matches) {
if (window.matchMedia(query.value).matches) {
matched = query;
}
}
Expand Down