mirror of
https://github.com/wassname/template.git
synced 2026-08-03 13:20:32 +08:00
explicitly trigger controller load event
This commit is contained in:
+5
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user