From 3d308274459c7ae4849e5c4f189b35c96d5bf6c3 Mon Sep 17 00:00:00 2001 From: Dailer Date: Mon, 25 Apr 2022 17:26:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=97=A0JIRA=20bi.search=5Feditor=20?= =?UTF-8?q?=E6=9C=89=E5=88=9D=E5=A7=8B=E5=80=BC=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=B8=85=E9=99=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/editor/editor.search.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index af9a14614..e333b047a 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -32,7 +32,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.clear = BI.createWidget({ type: "bi.icon_button", stopEvent: true, - cls: "close-font" + cls: "close-font", + invisible: !o.value }); this.clear.on(BI.IconButton.EVENT_CHANGE, function () { self.setValue(""); @@ -214,4 +215,4 @@ BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.search_editor", BI.SearchEditor); \ No newline at end of file +BI.shortcut("bi.search_editor", BI.SearchEditor); From d4546e6a0f1a2fa25e22bde97c3b4ae8ad791152 Mon Sep 17 00:00:00 2001 From: Dailer Date: Mon, 25 Apr 2022 17:27:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A0JIRA=20bi.search=5Feditor=20?= =?UTF-8?q?=E6=9C=89=E5=88=9D=E5=A7=8B=E5=80=BC=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=B8=85=E9=99=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/editor/editor.search.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index e333b047a..dac41e92d 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -124,8 +124,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.editor.on(BI.Editor.EVENT_STOP, function () { self.fireEvent(BI.SearchEditor.EVENT_STOP); }); - - this.clear.invisible(); }, _checkClear: function () { From 050267de06daddab7b04e8390c9c1abb75325af4 Mon Sep 17 00:00:00 2001 From: Dailer Date: Mon, 25 Apr 2022 19:17:38 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0JIRA=20bi.search=5Feditor=20?= =?UTF-8?q?=E6=9C=89=E5=88=9D=E5=A7=8B=E5=80=BC=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=B8=85=E9=99=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/editor/editor.search.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index dac41e92d..14f8cb5f4 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -10,7 +10,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, { errorText: "", watermark: BI.i18nText("BI-Basic_Search"), validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn + quitChecker: BI.emptyFn, + value: "" }); }, _init: function () { @@ -33,7 +34,7 @@ BI.SearchEditor = BI.inherit(BI.Widget, { type: "bi.icon_button", stopEvent: true, cls: "close-font", - invisible: !o.value + invisible: BI.isKey(o.value) }); this.clear.on(BI.IconButton.EVENT_CHANGE, function () { self.setValue("");