mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
move code in init file, remove menu helpers
This commit is contained in:
@@ -1,23 +1,19 @@
|
||||
///<amd-module name="main" />
|
||||
|
||||
import { makeEnvironment } from "./env";
|
||||
import { BaseMenuItem, processMenuItems } from "./misc/menu_helpers";
|
||||
import { init } from "./init";
|
||||
import { Root } from "./widgets/root";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Application bootstrapping
|
||||
// Web Client Bootstrapping
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async function() {
|
||||
const env = await makeEnvironment();
|
||||
const { env, menuInfo } = await init();
|
||||
|
||||
// menu processing
|
||||
const menuItems: BaseMenuItem[] = (<any>window).odoo.menus;
|
||||
const menuInfo = processMenuItems(menuItems);
|
||||
delete (<any>window).odoo.menus; // overkill?
|
||||
|
||||
// creating root widget
|
||||
// Creating root widget
|
||||
const rootWidget = new Root(env, { menuInfo });
|
||||
await rootWidget.mount(document.body);
|
||||
|
||||
// For debugging purpose, we keep a reference to the root widget in odoo
|
||||
(<any>window).odoo.rootWidget = rootWidget;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user