diff options
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/users/groups.js | 16 | ||||
-rw-r--r-- | settings/js/users/users.js | 5 |
2 files changed, 17 insertions, 4 deletions
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index 322db6c1b45..c8d2ef7c5b1 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -49,18 +49,26 @@ GroupList = { return parseInt($groupLiElement.data('usercount'), 10); }, - modEveryoneCount: function(diff) { - var $li = GroupList.getGroupLI(GroupList.everyoneGID); + modGroupCount: function(gid, diff) { + var $li = GroupList.getGroupLI(gid); var count = GroupList.getUserCount($li) + diff; GroupList.setUserCount($li, count); }, incEveryoneCount: function() { - GroupList.modEveryoneCount(1); + GroupList.modGroupCount(GroupList.everyoneGID, 1); }, decEveryoneCount: function() { - GroupList.modEveryoneCount(-1); + GroupList.modGroupCount(GroupList.everyoneGID, -1); + }, + + incGroupCount: function(gid) { + GroupList.modGroupCount(gid, 1); + }, + + decGroupCount: function(gid) { + GroupList.modGroupCount(gid, -1); }, getCurrentGID: function () { diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 47d63c11b95..519fe9655db 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -470,6 +470,11 @@ var UserList = { UserList.availableGroups.push(groupName); } + if (response.data.action === 'add') { + GroupList.incGroupCount(groupName); + } else { + GroupList.decGroupCount(groupName); + } } if (response.data.message) { OC.Notification.show(response.data.message); |