mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
24 lines
826 B
TypeScript
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;
|
|
});
|