]> source.dussan.org Git - nextcloud-server.git/commitdiff
provide feedback about minimum length needed to trigger search 21720/head
authorRobin Appelman <robin@icewind.nl>
Mon, 6 Jul 2020 16:07:53 +0000 (18:07 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 15 Jul 2020 09:19:51 +0000 (11:19 +0200)
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>
apps/files/js/filelist.js

index e7d48d4bcd13ff7a76ad1c321743d5ccc5e40f7f..55ddaf1b4de626e1bec83ead24f52bb4785e8249 100644 (file)
                                $('#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>'));
                                }