Browse Source

BI-61057 适配下传了iconCls的bi.button

es6
windy 5 years ago
parent
commit
84c7fec9e9
  1. 1
      changelog.md
  2. 8
      src/base/single/button/buttons/button.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志 # 更新日志
2.0(2020-05) 2.0(2020-05)
- 修复bi.button设置宽度并配置iconCls后,文本很长的情况下显示截断的问题
- 填加bi-user-select-enable和bi-user-select-disable通用类名 - 填加bi-user-select-enable和bi-user-select-disable通用类名
- 修复树系列多层半选状态下,勾选祖先节点,后代节点不受影响的问题 - 修复树系列多层半选状态下,勾选祖先节点,后代节点不受影响的问题
- 修复上传控件多个title问题 - 修复上传控件多个title问题

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

@ -9,6 +9,10 @@
*/ */
BI.Button = BI.inherit(BI.BasicButton, { BI.Button = BI.inherit(BI.BasicButton, {
_const: {
iconWidth: 18
},
_defaultConfig: function (props) { _defaultConfig: function (props) {
var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); var conf = BI.Button.superclass._defaultConfig.apply(this, arguments);
return BI.extend(conf, { return BI.extend(conf, {
@ -50,7 +54,7 @@ BI.Button = BI.inherit(BI.BasicButton, {
this.icon = BI.createWidget({ this.icon = BI.createWidget({
type: "bi.icon_label", type: "bi.icon_label",
cls: o.iconCls, cls: o.iconCls,
width: 18, width: this._const.iconWidth,
height: o.height - 2, height: o.height - 2,
iconWidth: o.iconWidth, iconWidth: o.iconWidth,
iconHeight: o.iconHeight iconHeight: o.iconHeight
@ -58,6 +62,8 @@ BI.Button = BI.inherit(BI.BasicButton, {
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.label", type: "bi.label",
text: o.text, text: o.text,
textWidth: BI.isNotNull(o.textWidth) ? o.textWidth - this._const.iconWidth : null,
textHeight: o.textHeight,
value: o.value, value: o.value,
height: o.height - 2 height: o.height - 2
}); });

Loading…
Cancel
Save