diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 16d915bac..9910f010f 100644 --- a/src/core/4.widget.js +++ b/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); } }, diff --git a/src/widget/date/calendar/popup.month.js b/src/widget/date/calendar/popup.month.js index 56d518e36..911f578a1 100644 --- a/src/widget/date/calendar/popup.month.js +++ b/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; },