Browse Source

KERNEL-13158: 优化下useContext,简单处理即可

es6
guy 2 years ago
parent
commit
6e3d59d8fb
  1. 8
      src/core/4.widget.js
  2. 4
      src/widget/date/calendar/popup.month.js

8
src/core/4.widget.js

@ -288,18 +288,14 @@
_initElementWidth: function () {
var o = this.options;
if (BI.isArray(o.width)) {
this.element.css("width", BI.pixFormat(...o.width));
} else if (BI.isWidthOrHeight(o.width)) {
if (BI.isWidthOrHeight(o.width)) {
this.element.css("width", BI.isNumber(o.width) ? BI.pixFormat(o.width) : o.width);
}
},
_initElementHeight: function () {
var o = this.options;
if (BI.isArray(o.height)) {
this.element.css("height", BI.pixFormat(...o.height));
} else if (BI.isWidthOrHeight(o.height)) {
if (BI.isWidthOrHeight(o.height)) {
this.element.css("height", BI.isNumber(o.height) ? BI.pixFormat(o.height) : o.height);
}
},

4
src/widget/date/calendar/popup.month.js

@ -49,6 +49,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
},
_getItems: function(m) {
BI.Widget.pushContext(this);
// 纵向排列月
var month = [1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12];
var items = [];
@ -67,7 +68,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
whiteSpace: "nowrap",
once: false,
forceSelected: true,
height: [BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, 1],
height: BI.pixFormat(BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, 1),
width: 30,
value: td,
text: td,
@ -75,6 +76,7 @@ BI.MonthPopup = BI.inherit(BI.Widget, {
};
});
});
BI.Widget.popContext();
return items;
},

Loading…
Cancel
Save