Files
meteor/packages/webapp/webapp_client.js
Emily Stark dd6d6a702b Fix eternal reload on pages with no stylesheets.
This fixes test-in-console, which was never completing test runs because
the page would reload constantly (or something).
2014-02-02 15:31:58 -08:00

16 lines
430 B
JavaScript

WebApp = {
_isCssLoaded: function () {
if (document.styleSheets.length === 0)
return true;
return _.find(document.styleSheets, function (sheet) {
if (sheet.cssText && !sheet.cssRules) // IE8
return !sheet.cssText.match(/meteor-css-not-found-error/);
return !_.find(sheet.cssRules, function (rule) {
return rule.selectorText === '.meteor-css-not-found-error';
});
});
}
};