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

8 lines
233 B
Plaintext
Raw Normal View History

2017-10-14 00:01:35 +00:00
var whenEnvIsLoaded = function(cb) {
if (typeof document !== 'undefined' && document !== null && !/comp|inter|loaded/.test(document.readyState)) {
2017-10-14 00:01:35 +00:00
document.addEventListener('DOMContentLoaded', cb);
} else {
cb();
}
}