Merge pull request #336 from cslarson/whenEnvIsLoaded
don't wait for DOMContentLoaded if it's already fired
This commit is contained in:
commit
abecdf941a
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue