Merge pull request #336 from cslarson/whenEnvIsLoaded

don't wait for DOMContentLoaded if it's already fired
This commit is contained in:
Iuri Matias 2018-02-22 10:18:07 -05:00 committed by GitHub
commit abecdf941a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
var whenEnvIsLoaded = function(cb) {
if (typeof document !== 'undefined' && document !== null) {
if (typeof document !== 'undefined' && document !== null && !/comp|inter|loaded/.test(document.readyState)) {
document.addEventListener('DOMContentLoaded', cb);
} else {
cb();