diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-09-03 17:18:00 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-09-10 23:15:42 +0200 |
commit | e7b0f8b001f8d84fa236a5ea4ebf13764a9646db (patch) | |
tree | 335125e66a6951b819ff077cf14b200cad12cfaf | |
parent | 210b0f092f93fa30f5c3542f684e55cc3ba5532f (diff) | |
download | nextcloud-server-e7b0f8b001f8d84fa236a5ea4ebf13764a9646db.tar.gz nextcloud-server-e7b0f8b001f8d84fa236a5ea4ebf13764a9646db.zip |
fix check for more users
after a refactor users et al were undefined. The check condition was moved.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | core/js/sharedialogview.js | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index da4d887634a..19d551149df 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -326,7 +326,23 @@ var suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(rooms).concat(lookup); - deferred.resolve(suggestions, exactMatches); + var moreResultsAvailable = + ( + oc_config['sharing.maxAutocompleteResults'] > 0 + && Math.min(perPage, oc_config['sharing.maxAutocompleteResults']) + <= Math.max( + users.length + exactUsers.length, + groups.length + exactGroups.length, + remoteGroups.length + exactRemoteGroups.length, + remotes.length + exactRemotes.length, + emails.length + exactEmails.length, + circles.length + exactCircles.length, + rooms.length + exactRooms.length, + lookup.length + ) + ); + + deferred.resolve(suggestions, exactMatches, moreResultsAvailable); } else { deferred.reject(result.ocs.meta.message); } @@ -385,7 +401,7 @@ search.term.trim(), perPage, view.model - ).done(function(suggestions) { + ).done(function(suggestions, exactMatches, moreResultsAvailable) { view._pendingOperationsCount--; if (view._pendingOperationsCount === 0) { $loading.addClass('hidden'); @@ -401,10 +417,7 @@ // show a notice that the list is truncated // this is the case if one of the search results is at least as long as the max result config option - if(oc_config['sharing.maxAutocompleteResults'] > 0 && - Math.min(perPage, oc_config['sharing.maxAutocompleteResults']) - <= Math.max(users.length, groups.length, remotes.length, emails.length, lookup.length)) { - + if(moreResultsAvailable) { var message = t('core', 'This list is maybe truncated - please refine your search term to see more results.'); $('.ui-autocomplete').append('<li class="autocomplete-note">' + message + '</li>'); } |