From f01b9152336195b66c5fc547879ce02d525322df Mon Sep 17 00:00:00 2001 From: iapyang Date: Fri, 7 May 2021 11:05:39 +0800 Subject: [PATCH] =?UTF-8?q?DEC-18525=20fix:=20=E5=8D=95=E9=80=89=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86popup=E9=AB=98=E5=BA=A6=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E9=81=AE=E6=8C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/singleselect/singleselect.list.js | 8 ++++++-- src/widget/singleselect/singleselect.loader.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/widget/singleselect/singleselect.list.js b/src/widget/singleselect/singleselect.list.js index 8d4b00b9e7..e09ed5f1af 100644 --- a/src/widget/singleselect/singleselect.list.js +++ b/src/widget/singleselect/singleselect.list.js @@ -7,6 +7,10 @@ */ BI.SingleSelectList = BI.inherit(BI.Widget, { + _constants: { + itemHeight: 24 + }, + _defaultConfig: function () { return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-select-list", @@ -61,7 +65,7 @@ BI.SingleSelectList = BI.inherit(BI.Widget, { items: o.allowNoSelect ? BI.LogicFactory.createLogicItemsByDirection(o.direction, { type: "bi.single_select_item", cls: "bi-list-item-active", - height: 24, + height: this._constants.itemHeight, forceNotSelected: true, text: BI.i18nText("BI-Basic_No_Select"), ref: function (_ref) { @@ -116,7 +120,7 @@ BI.SingleSelectList = BI.inherit(BI.Widget, { resetHeight: function (h) { this.list.resetHeight ? this.list.resetHeight(h) : - this.list.element.css({"max-height": h / BI.pixRatio + BI.pixUnit}); + this.list.element.css({"max-height": (h - (this.options.allowNoSelect ? this._constants.itemHeight : 0)) / BI.pixRatio + BI.pixUnit}); }, setNotSelectedValue: function () { diff --git a/src/widget/singleselect/singleselect.loader.js b/src/widget/singleselect/singleselect.loader.js index 201b3fffcb..8ac73f9850 100644 --- a/src/widget/singleselect/singleselect.loader.js +++ b/src/widget/singleselect/singleselect.loader.js @@ -6,6 +6,10 @@ */ BI.SingleSelectLoader = BI.inherit(BI.Widget, { + _constants: { + itemVgap: 5 + }, + _defaultConfig: function () { return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-single-select-loader", @@ -92,7 +96,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, { type: "bi.vertical", element: this, items: [this.button_group], - vgap: 5 + vgap: this._constants.itemVgap }); this.button_group.on(BI.Controller.EVENT_CHANGE, function () { @@ -151,7 +155,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, { }, resetHeight: function (h) { - this.button_group.resetHeight(h); + this.button_group.resetHeight(h - this._constants.itemVgap * 2); }, resetWidth: function (w) {