diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 4f103ab82..8e47d5a99 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -42,16 +42,6 @@ BI.Button = BI.inherit(BI.BasicButton, { _init: function () { BI.Button.superclass._init.apply(this, arguments); var o = this.options, self = this; - if (BI.isNumber(o.height) && !o.clear && !o.block) { - this.element.css({ - height: o.height / BI.pixRatio + BI.pixUnit, - lineHeight: (o.height - 2) / BI.pixRatio + BI.pixUnit - }); - } else if (o.clear || o.block) { - this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit}); - } else { - this.element.css({lineHeight: (o.height - 2) / BI.pixRatio + BI.pixUnit}); - } if (BI.isKey(o.iconCls)) { this.icon = BI.createWidget({ type: "bi.icon_label", @@ -83,7 +73,7 @@ BI.Button = BI.inherit(BI.BasicButton, { } else { this.text = BI.createWidget({ type: "bi.label", - height: o.height - 2, + height: o.height, textAlign: o.textAlign, whiteSpace: o.whiteSpace, textWidth: o.textWidth, @@ -99,6 +89,16 @@ BI.Button = BI.inherit(BI.BasicButton, { value: o.value }); } + if (BI.isNumber(o.height) && !o.clear && !o.block) { + this.element.css({ + height: o.height / BI.pixRatio + BI.pixUnit, + lineHeight: (o.height - 2) / BI.pixRatio + BI.pixUnit + }); + } else if (o.clear || o.block) { + this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit}); + } else { + this.element.css({lineHeight: (o.height - 2) / BI.pixRatio + BI.pixUnit}); + } if (o.block === true) { this.element.addClass("block"); }