Browse Source

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

es6
treecat 2 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)) { if (BI.isKey(o.iconCls)) {
this.icon = BI.createWidget({ this.icon = BI.createWidget({
type: "bi.icon_change_button", type: "bi.icon_label",
iconCls: o.iconCls, cls: o.iconCls,
width: this._const.iconWidth, width: this._const.iconWidth,
height: lineHeight, height: lineHeight,
lineHeight: lineHeight lineHeight: lineHeight
@ -195,10 +195,11 @@
} }
}, },
setIcon: function (iconCls) { setIcon: function (cls) {
if (this.icon) { var o = this.options;
this.options.iconCls = iconCls; if(this.icon && o.iconCls !== cls) {
this.icon.setIcon(iconCls); this.icon.element.removeClass(o.iconCls).addClass(cls);
o.iconCls = cls;
} }
}, },

Loading…
Cancel
Save