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>
This commit is contained in:
parent
210b0f092f
commit
e7b0f8b001
|
@ -326,7 +326,23 @@
|
||||||
|
|
||||||
var suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(rooms).concat(lookup);
|
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 {
|
} else {
|
||||||
deferred.reject(result.ocs.meta.message);
|
deferred.reject(result.ocs.meta.message);
|
||||||
}
|
}
|
||||||
|
@ -385,7 +401,7 @@
|
||||||
search.term.trim(),
|
search.term.trim(),
|
||||||
perPage,
|
perPage,
|
||||||
view.model
|
view.model
|
||||||
).done(function(suggestions) {
|
).done(function(suggestions, exactMatches, moreResultsAvailable) {
|
||||||
view._pendingOperationsCount--;
|
view._pendingOperationsCount--;
|
||||||
if (view._pendingOperationsCount === 0) {
|
if (view._pendingOperationsCount === 0) {
|
||||||
$loading.addClass('hidden');
|
$loading.addClass('hidden');
|
||||||
|
@ -401,10 +417,7 @@
|
||||||
|
|
||||||
// show a notice that the list is truncated
|
// 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
|
// 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 &&
|
if(moreResultsAvailable) {
|
||||||
Math.min(perPage, oc_config['sharing.maxAutocompleteResults'])
|
|
||||||
<= Math.max(users.length, groups.length, remotes.length, emails.length, lookup.length)) {
|
|
||||||
|
|
||||||
var message = t('core', 'This list is maybe truncated - please refine your search term to see more results.');
|
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>');
|
$('.ui-autocomplete').append('<li class="autocomplete-note">' + message + '</li>');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue