diff --git a/src/core/controller/controller.drawer.js b/src/core/controller/controller.drawer.js index 4b2daca9e..b808699c2 100644 --- a/src/core/controller/controller.drawer.js +++ b/src/core/controller/controller.drawer.js @@ -6,13 +6,17 @@ */ import Controller from "./0.controller"; export default class DrawerController extends Controller { + constructor() { + super(); + this._constructor(); + this.modal = this.options.modal; + } props = { modal: true, // 模态窗口 render: "body" } init() { - this.modal = this.options.modal; this.floatManager = {}; this.floatLayer = {}; this.floatContainer = {}; diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js index a2a6735b7..10092b560 100644 --- a/src/core/controller/controller.layer.js +++ b/src/core/controller/controller.layer.js @@ -6,6 +6,11 @@ */ import Controller from "./0.controller"; export default class LayerController extends Controller { + constructor() { + super(); + this._constructor(); + } + props = { render: "body" } diff --git a/src/core/controller/controller.popover.js b/src/core/controller/controller.popover.js index bcb129f3b..0c48b68ec 100644 --- a/src/core/controller/controller.popover.js +++ b/src/core/controller/controller.popover.js @@ -6,13 +6,18 @@ */ import Controller from "./0.controller"; export default class PopoverController extends Controller { + constructor() { + super(); + this._constructor(); + this.modal = this.options.modal; + } + props = { modal: true, // 模态窗口 render: "body" } init() { - this.modal = this.options.modal; this.floatManager = {}; this.floatLayer = {}; this.floatContainer = {}; @@ -50,7 +55,7 @@ export default class PopoverController extends Controller { const W = BI.Widget._renderEngine.createElement(this.options.render).width(), H = BI.Widget._renderEngine.createElement(this.options.render).height(); const w = popover.element.width(), h = popover.element.height(); - const left = (W - w) / 2, top = (H - h) / 2; + let left = (W - w) / 2, top = (H - h) / 2; if (left < 0) { left = 0; } @@ -110,9 +115,7 @@ export default class PopoverController extends Controller { }] }); this.floatManager[name] = popover; - (function (key) { - popover.on(BI.Popover.EVENT_CLOSE, () => self.close(key)); - })(name); + popover.on(BI.Popover.EVENT_CLOSE, () => this.close(name)); BI.createWidget({ type: "bi.absolute", element: options.container || this.options.render,