Merge pull request #1701 from nextcloud/impr-user-list
tidy up adding user to list a little bit
This commit is contained in:
commit
f590bb1b3a
|
@ -48,10 +48,8 @@ var UserList = {
|
|||
* 'email': 'username@example.org'
|
||||
* 'isRestoreDisabled':false
|
||||
* }
|
||||
* @param sort
|
||||
* @returns table row created for this user
|
||||
*/
|
||||
add: function (user, sort) {
|
||||
add: function (user) {
|
||||
if (this.currentGid && this.currentGid !== '_everyone' && _.indexOf(user.groups, this.currentGid) < 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -170,20 +168,12 @@ var UserList = {
|
|||
UserList.checkUsersToLoad();
|
||||
}
|
||||
|
||||
/**
|
||||
* sort list
|
||||
*/
|
||||
if (sort) {
|
||||
UserList.doSort();
|
||||
}
|
||||
|
||||
$quotaSelect.on('change', UserList.onQuotaSelect);
|
||||
|
||||
// defer init so the user first sees the list appear more quickly
|
||||
window.setTimeout(function(){
|
||||
$quotaSelect.singleSelect();
|
||||
}, 0);
|
||||
return $tr;
|
||||
},
|
||||
// From http://my.opera.com/GreyWyvern/blog/show.dml/1671288
|
||||
alphanum: function(a, b) {
|
||||
|
@ -389,8 +379,6 @@ var UserList = {
|
|||
OC.generateUrl('/settings/users/users'),
|
||||
{ offset: UserList.offset, limit: limit, gid: gid, pattern: pattern },
|
||||
function (result) {
|
||||
var loadedUsers = 0;
|
||||
var trs = [];
|
||||
//The offset does not mirror the amount of users available,
|
||||
//because it is backend-dependent. For correct retrieval,
|
||||
//always the limit(requested amount of users) needs to be added.
|
||||
|
@ -398,9 +386,7 @@ var UserList = {
|
|||
if(UserList.has(user.name)) {
|
||||
return true;
|
||||
}
|
||||
var $tr = UserList.add(user, false);
|
||||
trs.push($tr);
|
||||
loadedUsers++;
|
||||
UserList.add(user);
|
||||
});
|
||||
if (result.length > 0) {
|
||||
UserList.doSort();
|
||||
|
@ -867,7 +853,8 @@ $(document).ready(function () {
|
|||
}
|
||||
}
|
||||
if(!UserList.has(username)) {
|
||||
UserList.add(result, true);
|
||||
UserList.add(result);
|
||||
UserList.doSort();
|
||||
}
|
||||
$('#newusername').focus();
|
||||
GroupList.incEveryoneCount();
|
||||
|
|
Loading…
Reference in New Issue