mirror of
https://github.com/wekan/wekan.git
synced 2026-02-01 14:11:48 +01:00
Add icon to clear the current search
This commit is contained in:
parent
39b4ada26d
commit
20a2ea3e7a
2 changed files with 9 additions and 0 deletions
|
|
@ -32,6 +32,7 @@ template(name="globalSearch")
|
|||
.wrapper
|
||||
form.global-search-page.js-search-query-form
|
||||
input.global-search-query-input(
|
||||
style="{# if hasResults.get #}display: inline-block;{#/if#}"
|
||||
id="global-search-input"
|
||||
type="text"
|
||||
name="searchQuery"
|
||||
|
|
@ -39,6 +40,7 @@ template(name="globalSearch")
|
|||
value="{{ query.get }}"
|
||||
autofocus dir="auto"
|
||||
)
|
||||
a.js-new-search.fa.fa-eraser
|
||||
if searching.get
|
||||
+spinner
|
||||
else if hasResults.get
|
||||
|
|
|
|||
|
|
@ -249,6 +249,13 @@ class GlobalSearchComponent extends CardSearchPagedComponent {
|
|||
);
|
||||
document.getElementById('global-search-input').focus();
|
||||
},
|
||||
'click .js-new-search'(evt) {
|
||||
evt.preventDefault();
|
||||
const input = document.getElementById('global-search-input');
|
||||
input.value = '';
|
||||
this.query.set('');
|
||||
this.hasResults.set(false);
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue