explicitly trigger controller load event

This commit is contained in:
Ludwig Schubert
2017-11-08 10:16:10 -08:00
parent 399e832441
commit 2ab9a24a79
2 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -145,7 +145,11 @@ export const Controller = {
},
DOMContentLoaded() {
if (Controller.loaded || !domContentLoaded()) {
if (Controller.loaded) {
console.warn('Controller received DOMContentLoaded but was already loaded!');
return;
} else if (!domContentLoaded()) {
console.warn('Controller received DOMContentLoaded before appropriate document.readyState!');
return;
} else {
Controller.loaded = true;