mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
remove id generator from widget env
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user