[REF] extras: start loading templates earlier

This commit is contained in:
Géry Debongnie
2019-06-08 16:29:01 +02:00
parent b53a34b7d1
commit 2a19aeb6a3
+9 -5
View File
@@ -352,11 +352,15 @@ class TabbedEditor extends owl.Component {
//------------------------------------------------------------------------------
// Application initialization
//------------------------------------------------------------------------------
document.title = `${document.title} (v${owl.__info__.version})`;
document.addEventListener("DOMContentLoaded", async function() {
async function start() {
document.title = `${document.title} (v${owl.__info__.version})`;
const templates = await owl.utils.loadTemplates("templates.xml");
const qweb = new owl.QWeb(templates);
const env = { qweb };
const app = new App(env);
app.mount(document.body);
});
owl.utils.whenReady(() => {
const app = new App(env);
app.mount(document.body);
});
}
start();