From 9580b34637b8c02032b98f0c1d86d2e05b213c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 14 Mar 2019 09:03:39 +0100 Subject: [PATCH] remove id generator from widget env --- web/static/src/ts/core/component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/static/src/ts/core/component.ts b/web/static/src/ts/core/component.ts index e8d7599c..ae2c4bb2 100644 --- a/web/static/src/ts/core/component.ts +++ b/web/static/src/ts/core/component.ts @@ -5,6 +5,9 @@ import { init } from "../../../libs/snabbdom/src/snabbdom"; import { VNode } from "../../../libs/snabbdom/src/vnode"; import { EventBus } from "./event_bus"; import { QWeb } from "./qweb_vdom"; +import { idGenerator } from "./utils"; + +let getId = idGenerator(); //------------------------------------------------------------------------------ // Types/helpers @@ -12,7 +15,6 @@ import { QWeb } from "./qweb_vdom"; export interface WEnv { qweb: QWeb; - getID(): number; } let wl: any[] = []; @@ -84,11 +86,11 @@ export class Component< if (parent instanceof Component) { p = parent; this.env = parent.env; - id = this.env.getID(); + id = getId(); parent.__widget__.children[id] = this; } else { this.env = parent; - id = this.env.getID(); + id = getId(); } this.__widget__ = { id: id,