Merge pull request #13129 from owncloud/group-select-fix-autocomplete
Fix group select autocomplete
This commit is contained in:
commit
c740f4a4e4
|
@ -45,25 +45,21 @@ OC.Settings = _.extend(OC.Settings, {
|
||||||
data: queryData,
|
data: queryData,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data.status === "success") {
|
var results = [];
|
||||||
var results = [];
|
|
||||||
|
|
||||||
// add groups
|
// add groups
|
||||||
$.each(data.data.adminGroups, function(i, group) {
|
$.each(data.data.adminGroups, function(i, group) {
|
||||||
results.push({id:group.id, displayname:group.name});
|
results.push({id:group.id, displayname:group.name});
|
||||||
});
|
});
|
||||||
$.each(data.data.groups, function(i, group) {
|
$.each(data.data.groups, function(i, group) {
|
||||||
results.push({id:group.id, displayname:group.name});
|
results.push({id:group.id, displayname:group.name});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (query.term === '') {
|
if (query.term === '') {
|
||||||
// cache full list
|
// cache full list
|
||||||
self._cachedGroups = results;
|
self._cachedGroups = results;
|
||||||
}
|
|
||||||
query.callback({results: results});
|
|
||||||
} else {
|
|
||||||
//FIXME add error handling
|
|
||||||
}
|
}
|
||||||
|
query.callback({results: results});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 100, true),
|
}, 100, true),
|
||||||
|
|
Loading…
Reference in New Issue