1
0
Fork 0
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:
sauls8t 2018-06-13 15:54:58 +01:00
parent df9d9e174a
commit f70d4b33a3
3 changed files with 15 additions and 1 deletions

View file

@ -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();
}
}