Skip to content

Commit

Permalink
Rewrite some code so Closure Compiler doesn't freak out at 'invalid' …
Browse files Browse the repository at this point in the history
…(IE8) code.
  • Loading branch information
Bram Stein committed Mar 20, 2016
1 parent 3911d64 commit 35255ca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/core/domhelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,15 @@ goog.scope(function () {

function onMediaAvailable(callback) {
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].href && sheets[i].href.indexOf(href) !== -1 &&
(sheets[i].media && sheets[i].media === "all" || sheets[i].media.mediaText === "all")) {
return callback();
if (sheets[i].href && sheets[i].href.indexOf(href) !== -1 && sheets[i].media) {
/**
* @type {string|!MediaList}
*/
var media = sheets[i].media;

if (media === "all" || (media.mediaText && media.mediaText === "all")) {
return callback();
}
}
}

Expand Down

0 comments on commit 35255ca

Please sign in to comment.