provide feedback about minimum length needed to trigger search

instead of telling users that there are no results, tell them that search hasn't been triggered yet

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2020-07-06 18:07:53 +02:00 committed by Roeland Jago Douma
parent f04f9321df
commit 128910ebf1
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 6 additions and 1 deletions

View File

@ -3234,7 +3234,12 @@
$('#searchresults').addClass('filter-empty');
$('#searchresults .emptycontent').addClass('emptycontent-search');
if ( $('#searchresults').length === 0 || $('#searchresults').hasClass('hidden') ) {
var error = t('files', 'No search results in other folders for {tag}{filter}{endtag}', {filter:this._filter});
var error;
if (this._filter.length > 2) {
error = t('files', 'No search results in other folders for {tag}{filter}{endtag}', {filter:this._filter});
} else {
error = t('files', 'Enter more than two characters to search in other folders');
}
this.$el.find('.nofilterresults').removeClass('hidden').
find('p').html(error.replace('{tag}', '<strong>').replace('{endtag}', '</strong>'));
}