mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
widget is now a bus, add t-on directive on widgets
This commit is contained in:
@@ -2,8 +2,7 @@ import { Widget } from "../core/widget";
|
||||
import { Env, Menu } from "../env";
|
||||
|
||||
export interface Props {
|
||||
toggleHome: () => void;
|
||||
inMenu: boolean;
|
||||
inHome: boolean;
|
||||
}
|
||||
|
||||
export class Navbar extends Widget<Env, Props> {
|
||||
@@ -16,6 +15,6 @@ export class Navbar extends Widget<Env, Props> {
|
||||
|
||||
toggleHome(ev: MouseEvent) {
|
||||
ev.preventDefault();
|
||||
this.props.toggleHome();
|
||||
this.trigger("toggle-home-menu");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Notification } from "./notification";
|
||||
interface State {
|
||||
notifications: INotification[];
|
||||
stack: ActionStack;
|
||||
inMenu: boolean;
|
||||
inHome: boolean;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -28,7 +28,7 @@ export class Root extends Widget<Env, {}> {
|
||||
state: State = {
|
||||
notifications: [],
|
||||
stack: [],
|
||||
inMenu: false
|
||||
inHome: false
|
||||
};
|
||||
|
||||
constructor(env: Env) {
|
||||
@@ -47,6 +47,6 @@ export class Root extends Widget<Env, {}> {
|
||||
}
|
||||
|
||||
toggleHome() {
|
||||
this.updateState({ inMenu: !this.state.inMenu });
|
||||
this.updateState({ inHome: !this.state.inHome });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user