From 2d27257f50784b53cefb1eadffcca4e8c0337d9a Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 13 Mar 2022 17:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/trigger/trigger.icon.text.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/case/trigger/trigger.icon.text.js b/src/case/trigger/trigger.icon.text.js index eac94ab50..b820ebc71 100644 --- a/src/case/trigger/trigger.icon.text.js +++ b/src/case/trigger/trigger.icon.text.js @@ -6,15 +6,18 @@ * @extends BI.Trigger */ BI.IconTextTrigger = BI.inherit(BI.Trigger, { - _const: { - hgap: 4 - }, _defaultConfig: function () { var conf = BI.IconTextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24, + textHgap: 0, + textVgap: 0, + textLgap: 0, + textRgap: 0, + textTgap: 0, + textBgap: 0, iconHeight: null, iconWidth: null, textCls: "" @@ -23,12 +26,18 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { _init: function () { BI.IconTextTrigger.superclass._init.apply(this, arguments); - var self = this, o = this.options, c = this._const; + var self = this, o = this.options; this.text = BI.createWidget({ type: "bi.label", cls: "select-text-label" + (BI.isKey(o.textCls) ? (" " + o.textCls) : ""), textAlign: "left", height: o.height, + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + tgap: o.textTgap, + bgap: o.textBgap, text: o.text }); this.trigerButton = BI.createWidget({ @@ -38,7 +47,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { BI.createWidget({ element: this, - type: "bi.htape", + type: "bi.horizontal_fill", ref: function (_ref) { self.wrapper = _ref; }, @@ -76,13 +85,13 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { this.icon.setIcon(iconCls); var iconItem = this.wrapper.attr("items")[0]; var textItem = this.wrapper.attr("items")[1]; - if(BI.isNull(iconCls) || BI.isEmptyString(iconCls)) { + if (BI.isNull(iconCls) || BI.isEmptyString(iconCls)) { if(iconItem.width !== 0) { iconItem.width = 0; textItem.lgap = 5; this.wrapper.resize(); } - }else{ + } else { if(iconItem.width !== (o.iconWrapperWidth || o.height)) { iconItem.width = (o.iconWrapperWidth || o.height); textItem.lgap = 0;