From 65a5e30cc77f15e52be6319938f063633830b49f Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 21 Sep 2020 15:16:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?BI-73417=20fix:=20=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E4=B8=BA600=EF=BC=8C=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E7=AE=97=E4=B8=8Afooter=E7=9A=84=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/core/popup/demo.popover.js | 4 ++++ src/base/layer/layer.popover.js | 32 +++++++++++++++----------- src/less/base/layer/layer.popover.less | 13 ----------- 3 files changed, 23 insertions(+), 26 deletions(-) delete mode 100644 src/less/base/layer/layer.popover.less diff --git a/demo/js/core/popup/demo.popover.js b/demo/js/core/popup/demo.popover.js index 82a5e4a9db..1c736c34e7 100644 --- a/demo/js/core/popup/demo.popover.js +++ b/demo/js/core/popup/demo.popover.js @@ -189,6 +189,10 @@ Demo.Func = BI.inherit(BI.Widget, { }; }), }, + footer: { + type: "bi.label", + text: "这个是footer", + }, }).open(id); }, }], diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index d20167539a..7a31c5c9ca 100644 --- a/src/base/layer/layer.popover.js +++ b/src/base/layer/layer.popover.js @@ -10,6 +10,9 @@ BI.Popover = BI.inherit(BI.Widget, { NORMAL: "normal", BIG: "big", }, + MAX_HEIGHT: 600, + BODY_TGAP: 10, + BODY_HGAP: 20, }, props: { @@ -17,7 +20,6 @@ BI.Popover = BI.inherit(BI.Widget, { size: "normal", // small, normal, big logic: { dynamic: false, - maxHeight: 600, }, header: null, headerHeight: 40, @@ -29,6 +31,7 @@ BI.Popover = BI.inherit(BI.Widget, { render: function () { var self = this; var o = this.options; + var c = this._constant; this.startX = 0; this.startY = 0; var size = this._calculateSize(); @@ -87,28 +90,31 @@ BI.Popover = BI.inherit(BI.Widget, { height: o.headerHeight, }, height: o.headerHeight, - }, { - el: o.logic.dynamic ? { + }, o.logic.dynamic ? { + el: { type: "bi.vertical", - scrolly: false, + scrolly: true, cls: "popover-body", ref: function () { self.body = this; }, - hgap: 20, - tgap: 10, + css: { + "max-height": this._constant.MAX_HEIGHT - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP - 2, + }, items: [{ - el: BI.extend({}, o.body, { - extraCls: "dynamic-height-limit-layout-" + size.type, - }), + el: o.body, }], - } : { + }, + hgap: c.BODY_HGAP, + tgap: c.BODY_TGAP, + } : { + el: { type: "bi.absolute", items: [{ el: o.body, - left: 20, - top: 10, - right: 20, + left: c.BODY_HGAP, + top: c.BODY_TGAP, + right: c.BODY_HGAP, bottom: 0, }], }, diff --git a/src/less/base/layer/layer.popover.less b/src/less/base/layer/layer.popover.less deleted file mode 100644 index 6d038aeb44..0000000000 --- a/src/less/base/layer/layer.popover.less +++ /dev/null @@ -1,13 +0,0 @@ -@maxHeight: 600px; - -.bi-popover { - .dynamic-height-limit-layout-small { - min-height: 200px; - max-height: @maxHeight; - } - - .dynamic-height-limit-layout-big, .dynamic-height-limit-layout-default { - min-height: 500px; - max-height: @maxHeight; - } -} From 83bb10b20370890374fcde1c9325901e146d63e5 Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 21 Sep 2020 15:17:44 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index 7a31c5c9ca..5dc5fdc32f 100644 --- a/src/base/layer/layer.popover.js +++ b/src/base/layer/layer.popover.js @@ -99,7 +99,7 @@ BI.Popover = BI.inherit(BI.Widget, { self.body = this; }, css: { - "max-height": this._constant.MAX_HEIGHT - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP - 2, + "max-height": c.MAX_HEIGHT - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP - 2, }, items: [{ el: o.body, From 8aaf615c902cfcad73bc7979fe68fdfb8c58eecf Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 21 Sep 2020 15:25:55 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E9=9C=80=E8=A6=81=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popover.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index 5dc5fdc32f..214989004a 100644 --- a/src/base/layer/layer.popover.js +++ b/src/base/layer/layer.popover.js @@ -100,6 +100,7 @@ BI.Popover = BI.inherit(BI.Widget, { }, css: { "max-height": c.MAX_HEIGHT - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP - 2, + "min-height": size.height, }, items: [{ el: o.body, From 1c63cc8f965fa4beb6df31aceae693f14842e42e Mon Sep 17 00:00:00 2001 From: iapyang Date: Mon, 21 Sep 2020 15:26:21 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E9=9C=80=E8=A6=81=E5=87=8F=E5=8E=BB?= =?UTF-8?q?border=E7=9A=84=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/layer/layer.popover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index 214989004a..8de34fe250 100644 --- a/src/base/layer/layer.popover.js +++ b/src/base/layer/layer.popover.js @@ -146,7 +146,7 @@ BI.Popover = BI.inherit(BI.Widget, { scrolly: false, } : { type: "bi.vtape", - height: size.height, + height: size.height - 2, }); },