diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index 322db6c1b4..c8d2ef7c5b 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 47d63c11b9..519fe9655d 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);