mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
small cleanup
This commit is contained in:
@@ -6,7 +6,7 @@ const template = `
|
||||
<span class="title">Odoo</span>
|
||||
<ul>
|
||||
<li t-foreach="env.menus" t-as="menu">
|
||||
<a t-on-click="activateMenu(menu)" t-att-href="getUrl(menu)">
|
||||
<a t-att-href="getUrl(menu)">
|
||||
<t t-esc="menu.title"/>
|
||||
</a>
|
||||
</li>
|
||||
@@ -22,9 +22,4 @@ export class Navbar extends Widget<Env> {
|
||||
const action_id = String(menu.actionID);
|
||||
return this.env.router.formatURL("", { action_id });
|
||||
}
|
||||
|
||||
activateMenu(menu: Menu, event: MouseEvent) {
|
||||
event.preventDefault();
|
||||
this.env.actionManager.doAction(menu.actionID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Widget } from "../core/widget";
|
||||
import { Navbar } from "./navbar";
|
||||
import { ActionWidget } from "../services/action_manager";
|
||||
// import { Action } from "../services/actions";
|
||||
import { Env } from "../env";
|
||||
|
||||
const template = `
|
||||
@@ -35,25 +34,4 @@ export class RootWidget extends Widget<Env> {
|
||||
}
|
||||
this.content = newWidget;
|
||||
}
|
||||
|
||||
// onUrlChange() {
|
||||
// this.setMainWidget();
|
||||
// // notice that this can only be safely done because the root widget is
|
||||
// // mounted now.
|
||||
// this.render();
|
||||
// }
|
||||
|
||||
// getAction(): Action {
|
||||
// const routeInfo = this.env.router.getRoute();
|
||||
// const actionID = parseInt(routeInfo.query.action_id);
|
||||
// let actions: Action[] = this.env.actions;
|
||||
// let action = actions.find(a => a.id === actionID);
|
||||
// if (!action) {
|
||||
// action = actions.find(a => a.default === true);
|
||||
// if (!action) {
|
||||
// throw new Error("No valid action!");
|
||||
// }
|
||||
// }
|
||||
// return action;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user