From 8819ebeb8476ed1e600e8ed3cfeb7488573b89c3 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 11 Nov 2020 16:53:41 +0800 Subject: [PATCH] =?UTF-8?q?BI-75942=20&&=20BI-76055=20fix:=20Popover?= =?UTF-8?q?=E5=9C=A8=E5=B0=8F=E5=B1=8F=E5=B9=95=E4=B8=8A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=AE=8C=E6=95=B4=E6=97=A0=E6=B3=95=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/base/layer/layer.popover.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 15f54bde80..a9e6ffbc7d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-11) +- 修复了Popover小屏幕上看不完整的问题 - 颜色选择器支持输入16进制颜色编号 - bi.textarea_editor支持气泡提示报错 diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index 2132d35a0e..387d1ff4e7 100644 --- a/src/base/layer/layer.popover.js +++ b/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 = {};