embark/lib/modules/code_generator/code_templates/define-when-env-loaded.js.ejs

8 lines
233 B
Plaintext

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