Browse Source

DESIGN-4069 fix: button 的 setIcon 不使用 IconChangeButton

es6
treecat 3 years ago
parent
commit
0e4efcc66f
  1. 13
      src/base/single/button/buttons/button.js

13
src/base/single/button/buttons/button.js

@ -77,8 +77,8 @@
}
if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({
type: "bi.icon_change_button",
iconCls: o.iconCls,
type: "bi.icon_label",
cls: o.iconCls,
width: this._const.iconWidth,
height: lineHeight,
lineHeight: lineHeight
@ -195,10 +195,11 @@
}
},
setIcon: function (iconCls) {
if (this.icon) {
this.options.iconCls = iconCls;
this.icon.setIcon(iconCls);
setIcon: function (cls) {
var o = this.options;
if(this.icon && o.iconCls !== cls) {
this.icon.element.removeClass(o.iconCls).addClass(cls);
o.iconCls = cls;
}
},

Loading…
Cancel
Save