Browse Source

Pull request #1701: REPORT-45955 内边距可配

Merge in VISUAL/fineui from ~TELLER/fineui:bugfix to master

* commit '81adeeb34ae3e0b0937bcf9805ba30286f42a2b8':
  REPORT-45955 feat: 内边距可配
es6
Teller 4 years ago
parent
commit
b95ac16600
  1. 20
      src/base/layer/layer.popover.js

20
src/base/layer/layer.popover.js

@ -10,9 +10,7 @@ BI.Popover = BI.inherit(BI.Widget, {
NORMAL: "normal",
BIG: "big",
},
MAX_HEIGHT: 600,
BODY_TGAP: 10,
BODY_HGAP: 20,
MAX_HEIGHT: 600
},
props: {
@ -27,6 +25,8 @@ BI.Popover = BI.inherit(BI.Widget, {
footer: null,
footerHeight: 44,
closable: true, // BI-40839 是否显示右上角的关闭按钮
bodyHgap: 20,
bodyTgap: 10
},
render: function () {
@ -99,23 +99,23 @@ BI.Popover = BI.inherit(BI.Widget, {
self.body = this;
},
css: {
"max-height": this._getSuitableBodyHeight(c.MAX_HEIGHT - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP),
"max-height": this._getSuitableBodyHeight(c.MAX_HEIGHT - o.headerHeight - (o.footer ? o.footerHeight : 0) - o.bodyTgap),
"min-height": this._getSuitableBodyHeight(size.height),
},
items: [{
el: o.body,
}],
},
hgap: c.BODY_HGAP,
tgap: c.BODY_TGAP,
hgap: o.bodyHgap,
tgap: o.bodyTgap,
} : {
el: {
type: "bi.absolute",
items: [{
el: o.body,
left: c.BODY_HGAP,
top: c.BODY_TGAP,
right: c.BODY_HGAP,
left: o.bodyHgap,
top: o.bodyTgap,
right: o.bodyHgap,
bottom: 0,
}],
},
@ -163,7 +163,7 @@ BI.Popover = BI.inherit(BI.Widget, {
_getSuitableBodyHeight: function (height) {
var o = this.options;
var c = this._constant;
return BI.clamp(height, 0, BI.Widget._renderEngine.createElement("body")[0].clientHeight - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP);
return BI.clamp(height, 0, BI.Widget._renderEngine.createElement("body")[0].clientHeight - o.headerHeight - (o.footer ? o.footerHeight : 0) - o.bodyTgap);
},
_getSuitableHeight: function (height) {

Loading…
Cancel
Save