|
|
@ -6,13 +6,18 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
import Controller from "./0.controller"; |
|
|
|
import Controller from "./0.controller"; |
|
|
|
export default class PopoverController extends Controller { |
|
|
|
export default class PopoverController extends Controller { |
|
|
|
|
|
|
|
constructor() { |
|
|
|
|
|
|
|
super(); |
|
|
|
|
|
|
|
this._constructor(); |
|
|
|
|
|
|
|
this.modal = this.options.modal; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
props = { |
|
|
|
props = { |
|
|
|
modal: true, // 模态窗口
|
|
|
|
modal: true, // 模态窗口
|
|
|
|
render: "body" |
|
|
|
render: "body" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
init() { |
|
|
|
init() { |
|
|
|
this.modal = this.options.modal; |
|
|
|
|
|
|
|
this.floatManager = {}; |
|
|
|
this.floatManager = {}; |
|
|
|
this.floatLayer = {}; |
|
|
|
this.floatLayer = {}; |
|
|
|
this.floatContainer = {}; |
|
|
|
this.floatContainer = {}; |
|
|
@ -50,7 +55,7 @@ export default class PopoverController extends Controller { |
|
|
|
const W = BI.Widget._renderEngine.createElement(this.options.render).width(), |
|
|
|
const W = BI.Widget._renderEngine.createElement(this.options.render).width(), |
|
|
|
H = BI.Widget._renderEngine.createElement(this.options.render).height(); |
|
|
|
H = BI.Widget._renderEngine.createElement(this.options.render).height(); |
|
|
|
const w = popover.element.width(), h = popover.element.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) { |
|
|
|
if (left < 0) { |
|
|
|
left = 0; |
|
|
|
left = 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -110,9 +115,7 @@ export default class PopoverController extends Controller { |
|
|
|
}] |
|
|
|
}] |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.floatManager[name] = popover; |
|
|
|
this.floatManager[name] = popover; |
|
|
|
(function (key) { |
|
|
|
popover.on(BI.Popover.EVENT_CLOSE, () => this.close(name)); |
|
|
|
popover.on(BI.Popover.EVENT_CLOSE, () => self.close(key)); |
|
|
|
|
|
|
|
})(name); |
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
element: options.container || this.options.render, |
|
|
|
element: options.container || this.options.render, |
|
|
|