From 802d9845763e04611a625c885486a3b9477c6869 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 22 Oct 2022 17:01:22 +0800 Subject: [PATCH] bugfix --- src/case/trigger/trigger.editor.js | 2 +- src/case/trigger/trigger.icon.text.js | 20 ++++--------------- src/case/trigger/trigger.text.js | 5 +++-- src/case/trigger/trigger.text.small.js | 2 +- .../combo.textvaluedownlist.js | 2 +- 5 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/case/trigger/trigger.editor.js b/src/case/trigger/trigger.editor.js index 4998ea583..7b2c39e3c 100644 --- a/src/case/trigger/trigger.editor.js +++ b/src/case/trigger/trigger.editor.js @@ -67,7 +67,7 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, { type: "bi.trigger_icon_button", width: o.triggerWidth || BI.pixFormat(o.height, 2) }, - width: o.triggerWidth || BI.pixFormat(o.height, 2) + width: "" } ] }); diff --git a/src/case/trigger/trigger.icon.text.js b/src/case/trigger/trigger.icon.text.js index 36d156e13..a102b5d0c 100644 --- a/src/case/trigger/trigger.icon.text.js +++ b/src/case/trigger/trigger.icon.text.js @@ -42,7 +42,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { BI.createWidget({ element: this, type: "bi.horizontal_fill", - columnSize: [BI.isEmptyString(o.iconCls) ? 0 : (o.iconWrapperWidth || o.height), "fill", o.triggerWidth || o.height], + columnSize: ["", "fill", ""], ref: function (_ref) { self.wrapper = _ref; }, @@ -50,7 +50,9 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { el: { type: "bi.icon_change_button", cls: "icon-combo-trigger-icon", + width: o.triggerWidth || o.height, iconCls: o.iconCls, + invisible: !o.iconCls, ref: function (_ref) { self.icon = _ref; }, @@ -74,21 +76,7 @@ BI.IconTextTrigger = BI.inherit(BI.Trigger, { setIcon: function (iconCls) { var o = this.options; 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 (iconItem.width !== 0) { - iconItem.width = 0; - textItem.lgap = 5; - this.wrapper.resize(); - } - } else { - if (iconItem.width !== (o.iconWrapperWidth || o.height)) { - iconItem.width = (o.iconWrapperWidth || o.height); - textItem.lgap = 0; - this.wrapper.resize(); - } - } + this.icon.setVisible(!!iconCls); }, setTextCls: function (cls) { diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index fe72fde60..6e7273252 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -60,7 +60,7 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { return ({ type: "bi.horizontal_fill", - columnSize: ["fill", o.triggerWidth || o.height], + columnSize: ["fill", ""], items: [ { el: label, @@ -68,6 +68,8 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { }, { el: o.allowClear ? { type: "bi.vertical_adapt", + width: o.triggerWidth || o.height, + height: o.height, horizontalAlign: "left", scrollable: false, items: [ @@ -80,7 +82,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { cls: "close-h-font " + (o.allowClear ? "clear-button" : ""), stopPropagation: true, width: o.triggerWidth || o.height, - height: o.height, invisible: !BI.isNotEmptyString(o.text), handler: function () { self.fireEvent(BI.TextTrigger.EVENT_CLEAR); diff --git a/src/case/trigger/trigger.text.small.js b/src/case/trigger/trigger.text.small.js index 6fbb04c3c..27c395a69 100644 --- a/src/case/trigger/trigger.text.small.js +++ b/src/case/trigger/trigger.text.small.js @@ -43,7 +43,7 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, { width: "fill" }, { el: this.trigerButton, - width: o.triggerWidth || o.height + width: "" } ] }); diff --git a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js b/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js index 146472c30..2a1e254fd 100644 --- a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js +++ b/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js @@ -5,7 +5,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { _defaultConfig: function (config) { return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-text-value-down-list-combo " + (config.simple ? "bi-border-bottom" : "bi-border"), + baseCls: "bi-text-value-down-list-combo bi-border-radius " + (config.simple ? "bi-border-bottom" : "bi-border"), height: 24, }); },