Browse Source

BI-75942 && BI-76055 fix: Popover在小屏幕上显示不完整无法操作

es6
windy 4 years ago
parent
commit
8819ebeb84
  1. 1
      changelog.md
  2. 12
      src/base/layer/layer.popover.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2020-11)
- 修复了Popover小屏幕上看不完整的问题
- 颜色选择器支持输入16进制颜色编号
- bi.textarea_editor支持气泡提示报错

12
src/base/layer/layer.popover.js

@ -99,8 +99,8 @@ BI.Popover = BI.inherit(BI.Widget, {
self.body = this;
},
css: {
"max-height": c.MAX_HEIGHT - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP,
"min-height": size.height,
"max-height": this._getSuitableBodyHeight(c.MAX_HEIGHT - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP),
"min-height": this._getSuitableBodyHeight(size.height),
},
items: [{
el: o.body,
@ -146,7 +146,7 @@ BI.Popover = BI.inherit(BI.Widget, {
scrolly: false,
} : {
type: "bi.vtape",
height: size.height,
height: BI.clamp(size.height, 0, BI.Widget._renderEngine.createElement("body")[0].clientHeight),
});
},
@ -160,6 +160,12 @@ 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);
},
_calculateSize: function () {
var o = this.options;
var size = {};

Loading…
Cancel
Save