remove id generator from widget env

This commit is contained in:
Géry Debongnie
2019-03-14 09:03:39 +01:00
parent 03ffcc02ea
commit 9580b34637
+5 -3
View File
@@ -5,6 +5,9 @@ import { init } from "../../../libs/snabbdom/src/snabbdom";
import { VNode } from "../../../libs/snabbdom/src/vnode"; import { VNode } from "../../../libs/snabbdom/src/vnode";
import { EventBus } from "./event_bus"; import { EventBus } from "./event_bus";
import { QWeb } from "./qweb_vdom"; import { QWeb } from "./qweb_vdom";
import { idGenerator } from "./utils";
let getId = idGenerator();
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Types/helpers // Types/helpers
@@ -12,7 +15,6 @@ import { QWeb } from "./qweb_vdom";
export interface WEnv { export interface WEnv {
qweb: QWeb; qweb: QWeb;
getID(): number;
} }
let wl: any[] = []; let wl: any[] = [];
@@ -84,11 +86,11 @@ export class Component<
if (parent instanceof Component) { if (parent instanceof Component) {
p = parent; p = parent;
this.env = parent.env; this.env = parent.env;
id = this.env.getID(); id = getId();
parent.__widget__.children[id] = this; parent.__widget__.children[id] = this;
} else { } else {
this.env = parent; this.env = parent;
id = this.env.getID(); id = getId();
} }
this.__widget__ = { this.__widget__ = {
id: id, id: id,