Browse Source

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

Merge in VISUAL/fineui from ~ZHENFEI.LI/fineui:es6 to es6

* commit '67cfec57aec6464bf1f5a6552c8ba2d612b311a4':
  KERNEL-13947 refactor: 处理继承OB对象的执行顺序问题
es6
Zhenfei.Li-李振飞 2 years ago
parent
commit
517df399d5
  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