23 lines
491 B
JavaScript
23 lines
491 B
JavaScript
|
class Startup {
|
||
|
constructor() {
|
||
|
this.modules = {
|
||
|
'startup': false,
|
||
|
'id3-ready': false
|
||
|
};
|
||
|
}
|
||
|
|
||
|
moduleLoaded(name) {
|
||
|
this.modules[name] = true
|
||
|
this.allModulesLoaded();
|
||
|
}
|
||
|
|
||
|
allModulesLoaded() {
|
||
|
for (let module in this.modules) {
|
||
|
if (!this.modules[module]) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
window.dispatchEvent(new CustomEvent('startupFin'));
|
||
|
return true;
|
||
|
}
|
||
|
}
|