Skip to content
Snippets Groups Projects
Commit aaabe356 authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

Merge pull request #19520 from owncloud/issue-17420-modify-group-count-when-changing-memberships

Modify the group user count when changing membership of a user
parents 3dec30d0 3ce45863
Branches
No related tags found
No related merge requests found
......@@ -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 () {
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment