Browse Source

Pull request #2654: 无JIRA bi.search_editor 有初始值的时候显示清除按钮

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '050267de06daddab7b04e8390c9c1abb75325af4':
  无JIRA bi.search_editor 有初始值的时候显示清除按钮
  无JIRA bi.search_editor 有初始值的时候显示清除按钮
  无JIRA bi.search_editor 有初始值的时候显示清除按钮
es6
Dailer 3 years ago
parent
commit
5c04cc0fc2
  1. 10
      src/widget/editor/editor.search.js

10
src/widget/editor/editor.search.js

@ -10,7 +10,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
errorText: "", errorText: "",
watermark: BI.i18nText("BI-Basic_Search"), watermark: BI.i18nText("BI-Basic_Search"),
validationChecker: BI.emptyFn, validationChecker: BI.emptyFn,
quitChecker: BI.emptyFn quitChecker: BI.emptyFn,
value: ""
}); });
}, },
_init: function () { _init: function () {
@ -32,7 +33,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
this.clear = BI.createWidget({ this.clear = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
stopEvent: true, stopEvent: true,
cls: "close-font" cls: "close-font",
invisible: BI.isKey(o.value)
}); });
this.clear.on(BI.IconButton.EVENT_CHANGE, function () { this.clear.on(BI.IconButton.EVENT_CHANGE, function () {
self.setValue(""); self.setValue("");
@ -123,8 +125,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
this.editor.on(BI.Editor.EVENT_STOP, function () { this.editor.on(BI.Editor.EVENT_STOP, function () {
self.fireEvent(BI.SearchEditor.EVENT_STOP); self.fireEvent(BI.SearchEditor.EVENT_STOP);
}); });
this.clear.invisible();
}, },
_checkClear: function () { _checkClear: function () {
@ -214,4 +214,4 @@ BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER";
BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT";
BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE";
BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY";
BI.shortcut("bi.search_editor", BI.SearchEditor); BI.shortcut("bi.search_editor", BI.SearchEditor);

Loading…
Cancel
Save