fix race condition when settings.js loads faster than the dom is parsed

This commit is contained in:
codl 2017-09-01 02:15:01 +02:00
parent 8506c920b6
commit e02b761b53
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import Banner from '../components/Banner.html';
(function(){
function settings_init(){
if(!('fetch' in window)){
return;
}
@ -166,4 +166,11 @@ import Banner from '../components/Banner.html';
})();
}
if(document.readyState == 'interactive'){
settings_init()
}
else {
document.addEventListener('DOMContentLoaded', settings_init);
}