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