Files
owl/web/static/src/ts/main.ts
T
2019-02-05 16:04:02 +01:00

24 lines
826 B
TypeScript

///<amd-module name="main" />
import { makeEnvironment } from "./env";
import { BaseMenuItem, processMenuItems } from "./misc/menu_helpers";
import { Root } from "./widgets/root";
//------------------------------------------------------------------------------
// Application bootstrapping
//------------------------------------------------------------------------------
document.addEventListener("DOMContentLoaded", async function() {
const env = await makeEnvironment();
// menu processing
const menuItems: BaseMenuItem[] = (<any>window).odoo.menus;
const menuInfo = processMenuItems(menuItems);
delete (<any>window).odoo.menus; // overkill?
// creating root widget
const rootWidget = new Root(env, { menuInfo });
await rootWidget.mount(document.body);
(<any>window).odoo.rootWidget = rootWidget;
});