From 81adeeb34ae3e0b0937bcf9805ba30286f42a2b8 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 23 Dec 2020 17:23:54 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-45955=20feat:=20=E5=86=85=E8=BE=B9?= =?UTF-8?q?=E8=B7=9D=E5=8F=AF=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popover.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index 1a80c88fe..4c6bfe0e6 100644 --- a/src/base/layer/layer.popover.js +++ b/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) {