diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-10-13 12:23:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-13 12:23:12 +0200 |
commit | f590bb1b3a6edf2ca9cf4a623b7299f4f7b0806a (patch) | |
tree | 8a001b001d868004b4150f7c23573728c30b2032 | |
parent | 05869e4d22be971050133b7b507c992b3cab6a38 (diff) | |
parent | e378cadb56a62463c13ff8d1721d807f51758652 (diff) | |
download | nextcloud-server-f590bb1b3a6edf2ca9cf4a623b7299f4f7b0806a.tar.gz nextcloud-server-f590bb1b3a6edf2ca9cf4a623b7299f4f7b0806a.zip |
Merge pull request #1701 from nextcloud/impr-user-list
tidy up adding user to list a little bit
-rw-r--r-- | settings/js/users/users.js | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 271188875da..d25f9d92db2 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -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(); |