fix race condition when settings.js loads faster than the dom is parsed
This commit is contained in:
parent
8506c920b6
commit
e02b761b53
|
@ -1,6 +1,6 @@
|
||||||
import Banner from '../components/Banner.html';
|
import Banner from '../components/Banner.html';
|
||||||
|
|
||||||
(function(){
|
function settings_init(){
|
||||||
if(!('fetch' in window)){
|
if(!('fetch' in window)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -166,4 +166,11 @@ import Banner from '../components/Banner.html';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})();
|
}
|
||||||
|
|
||||||
|
if(document.readyState == 'interactive'){
|
||||||
|
settings_init()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.addEventListener('DOMContentLoaded', settings_init);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue