From 84c7fec9e9335ce0fcfbb7cacfd46b89f2fe0341 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 27 May 2020 09:21:03 +0800 Subject: [PATCH] =?UTF-8?q?BI-61057=20=E9=80=82=E9=85=8D=E4=B8=8B=E4=BC=A0?= =?UTF-8?q?=E4=BA=86iconCls=E7=9A=84bi.button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/base/single/button/buttons/button.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index c60ea6a88..5857959e2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-05) +- 修复bi.button设置宽度并配置iconCls后,文本很长的情况下显示截断的问题 - 填加bi-user-select-enable和bi-user-select-disable通用类名 - 修复树系列多层半选状态下,勾选祖先节点,后代节点不受影响的问题 - 修复上传控件多个title问题 diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 85ab78d06..52461bdfd 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -9,6 +9,10 @@ */ BI.Button = BI.inherit(BI.BasicButton, { + _const: { + iconWidth: 18 + }, + _defaultConfig: function (props) { var conf = BI.Button.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { @@ -50,7 +54,7 @@ BI.Button = BI.inherit(BI.BasicButton, { this.icon = BI.createWidget({ type: "bi.icon_label", cls: o.iconCls, - width: 18, + width: this._const.iconWidth, height: o.height - 2, iconWidth: o.iconWidth, iconHeight: o.iconHeight @@ -58,6 +62,8 @@ BI.Button = BI.inherit(BI.BasicButton, { this.text = BI.createWidget({ type: "bi.label", text: o.text, + textWidth: BI.isNotNull(o.textWidth) ? o.textWidth - this._const.iconWidth : null, + textHeight: o.textHeight, value: o.value, height: o.height - 2 });