preliminary work for better menu support

This commit is contained in:
Géry Debongnie
2019-02-03 14:14:09 +01:00
parent e1bdce57ee
commit 34475a5002
4 changed files with 193 additions and 12 deletions
+7 -7
View File
@@ -1,7 +1,8 @@
import { INotification } from "../core/notifications";
import { Widget } from "../core/widget";
import { Env } from "../env";
import { MenuInfo } from "../misc/menu_helpers";
import { ActionStack } from "../services/action_manager";
import { INotification } from "../core/notifications";
import { ActionContainer } from "./action_container";
import { HomeMenu } from "./home_menu";
import { Navbar } from "./navbar";
@@ -17,11 +18,15 @@ interface State {
inHome: boolean;
}
interface Props {
menuInfo: MenuInfo;
}
//------------------------------------------------------------------------------
// Root Widget
//------------------------------------------------------------------------------
export class Root extends Widget<Env, {}> {
export class Root extends Widget<Env, Props> {
template = "web.web_client";
widgets = { Navbar, Notification, HomeMenu, ActionContainer };
@@ -31,11 +36,6 @@ export class Root extends Widget<Env, {}> {
inHome: false
};
constructor(env: Env) {
super(env);
this.toggleHome = this.toggleHome.bind(this);
}
mounted() {
this.env.notifications.on("notifications_updated", this, notifs =>
this.updateState({ notifications: notifs })