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
This commit is contained in:
commit
aaabe356b5
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue