mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 23:27:09 +00:00
Load schemas after DOM content is loaded
This commit is contained in:
@@ -73,13 +73,14 @@ export const App = {
|
||||
settings: new Settings('generator_settings'),
|
||||
blockStateRegistry: {} as BlockStateRegistry
|
||||
}
|
||||
console.debug(`[App] LocalStorage=${'localStorage' in window} Caches=${'caches' in window}`)
|
||||
|
||||
App.version.watchRun(async (value) => {
|
||||
console.debug(`[App.version.watchRun] ${value}`)
|
||||
App.version.watch(async (value) => {
|
||||
console.debug(`[App.version.watch] ${value}`)
|
||||
App.schemasLoaded.set(false)
|
||||
await updateSchemas(value)
|
||||
App.schemasLoaded.set(true)
|
||||
console.debug(`[App.version.watchRun] Done! ${value}`)
|
||||
console.debug(`[App.version.watch] Done! ${value}`)
|
||||
})
|
||||
|
||||
App.theme.watchRun((value) => {
|
||||
|
||||
@@ -66,6 +66,7 @@ window.addEventListener("popstate", router);
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
console.debug(`[DOMContentLoaded] LocalStorage=${'localStorage' in window} Caches=${'caches' in window}`)
|
||||
App.version.trigger()
|
||||
document.body.addEventListener("click", e => {
|
||||
if (e.target instanceof Element
|
||||
&& e.target.hasAttribute('data-link')
|
||||
|
||||
@@ -37,4 +37,8 @@ export class Property<T> {
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
trigger() {
|
||||
this.watchers.forEach(w => w.watcher(this.value, null))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user