Browse Source

KERNEL-13947 refactor: 处理继承OB对象的执行顺序问题

es6
Zhenfei.Li 2 years ago
parent
commit
67cfec57ae
  1. 6
      src/core/controller/controller.drawer.js
  2. 5
      src/core/controller/controller.layer.js
  3. 13
      src/core/controller/controller.popover.js

6
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 = {};

5
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"
}

13
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,

Loading…
Cancel
Save