Browse Source

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

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '8819ebeb8476ed1e600e8ed3cfeb7488573b89c3':
  BI-75942 && BI-76055 fix: Popover在小屏幕上显示不完整无法操作
es6
windy 4 years ago
parent
commit
9c24a3b414
  1. 1
      changelog.md
  2. 12
      src/base/layer/layer.popover.js

1
changelog.md

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

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

@ -99,8 +99,8 @@ BI.Popover = BI.inherit(BI.Widget, {
self.body = this; self.body = this;
}, },
css: { css: {
"max-height": 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) - c.BODY_TGAP),
"min-height": size.height, "min-height": this._getSuitableBodyHeight(size.height),
}, },
items: [{ items: [{
el: o.body, el: o.body,
@ -146,7 +146,7 @@ BI.Popover = BI.inherit(BI.Widget, {
scrolly: false, scrolly: false,
} : { } : {
type: "bi.vtape", 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 () { _calculateSize: function () {
var o = this.options; var o = this.options;
var size = {}; var size = {};

Loading…
Cancel
Save