mirror of
https://github.com/documize/community.git
synced 2025-07-25 08:09:43 +02:00
Warn if search criteria too short
Minimum keywords > 3
This commit is contained in:
parent
df9d9e174a
commit
f70d4b33a3
3 changed files with 15 additions and 1 deletions
|
@ -16,6 +16,7 @@ import Component from '@ember/component';
|
|||
export default Component.extend({
|
||||
searchSvc: service('search'),
|
||||
results: A([]),
|
||||
validSearch: true,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
@ -50,6 +51,12 @@ export default Component.extend({
|
|||
|
||||
actions: {
|
||||
onSearch() {
|
||||
if (this.get('filter').trim().length < 3) {
|
||||
this.set('validSearch', false);
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('validSearch', true);
|
||||
this.fetch();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue