summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-10-17 21:57:47 +0200
committerJulius Härtl <jus@bitgrid.net>2018-10-30 10:19:34 +0100
commit06d8438fdab04371532d5bbf7f482bf3fca7c526 (patch)
tree3a528a6935cc975c86c520682e68a2a0201a0c82
parenta1c6e44700d255654838836f4bf5dd00272605bd (diff)
downloadnextcloud-server-06d8438fdab04371532d5bbf7f482bf3fca7c526.tar.gz
nextcloud-server-06d8438fdab04371532d5bbf7f482bf3fca7c526.zip
Group share suggestions by userid
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--core/js/sharedialogview.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index baf70fa63ad..2c31a96324f 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -312,6 +312,12 @@
var suggestions = exactMatches.concat(users).concat(groups).concat(remotes).concat(remoteGroups).concat(emails).concat(circles).concat(rooms).concat(lookup);
+ function dynamicSort(property) {
+ return function (a,b) {
+ return (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;
+ }
+ }
+ var grouped = suggestions.sort(dynamicSort('uuid'));
var moreResultsAvailable =
(
oc_config['sharing.maxAutocompleteResults'] > 0
@@ -328,7 +334,7 @@
)
);
- deferred.resolve(suggestions, exactMatches, moreResultsAvailable);
+ deferred.resolve(grouped, exactMatches, moreResultsAvailable);
} else {
deferred.reject(result.ocs.meta.message);
}