Browse Source

DEC-18525 fix: 单选下拉框popup高度计算错误导致遮挡

es6
iapyang 4 years ago
parent
commit
f01b915233
  1. 8
      src/widget/singleselect/singleselect.list.js
  2. 8
      src/widget/singleselect/singleselect.loader.js

8
src/widget/singleselect/singleselect.list.js

@ -7,6 +7,10 @@
*/ */
BI.SingleSelectList = BI.inherit(BI.Widget, { BI.SingleSelectList = BI.inherit(BI.Widget, {
_constants: {
itemHeight: 24
},
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-select-list", baseCls: "bi-select-list",
@ -61,7 +65,7 @@ BI.SingleSelectList = BI.inherit(BI.Widget, {
items: o.allowNoSelect ? BI.LogicFactory.createLogicItemsByDirection(o.direction, { items: o.allowNoSelect ? BI.LogicFactory.createLogicItemsByDirection(o.direction, {
type: "bi.single_select_item", type: "bi.single_select_item",
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: 24, height: this._constants.itemHeight,
forceNotSelected: true, forceNotSelected: true,
text: BI.i18nText("BI-Basic_No_Select"), text: BI.i18nText("BI-Basic_No_Select"),
ref: function (_ref) { ref: function (_ref) {
@ -116,7 +120,7 @@ BI.SingleSelectList = BI.inherit(BI.Widget, {
resetHeight: function (h) { resetHeight: function (h) {
this.list.resetHeight ? this.list.resetHeight(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 () { setNotSelectedValue: function () {

8
src/widget/singleselect/singleselect.loader.js

@ -6,6 +6,10 @@
*/ */
BI.SingleSelectLoader = BI.inherit(BI.Widget, { BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_constants: {
itemVgap: 5
},
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-select-loader", baseCls: "bi-single-select-loader",
@ -92,7 +96,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
type: "bi.vertical", type: "bi.vertical",
element: this, element: this,
items: [this.button_group], items: [this.button_group],
vgap: 5 vgap: this._constants.itemVgap
}); });
this.button_group.on(BI.Controller.EVENT_CHANGE, function () { this.button_group.on(BI.Controller.EVENT_CHANGE, function () {
@ -151,7 +155,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
}, },
resetHeight: function (h) { resetHeight: function (h) {
this.button_group.resetHeight(h); this.button_group.resetHeight(h - this._constants.itemVgap * 2);
}, },
resetWidth: function (w) { resetWidth: function (w) {

Loading…
Cancel
Save