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) {