decrease user count in affected groups after user delete

This commit is contained in:
Arthur Schiwon 2014-07-05 02:14:08 +02:00 committed by Thomas Müller
parent a584022ecc
commit 5e5a02cc2f
1 changed files with 14 additions and 0 deletions

View File

@ -238,6 +238,20 @@ var UserList = {
UserList.getRow(uid).show();
},
remove: function(uid) {
$tr = UserList.getRow(uid);
groups = $tr.find('.groups .groupsselect').val();
for(i in groups) {
var gid = groups[i];
$li = GroupList.getGroupLI(gid);
userCount = GroupList.getUserCount($li);
if(userCount == 1) {
newUserCount = '';
} else {
newUserCount = userCount - 1;
}
GroupList.setUserCount($li, newUserCount);
}
UserList.getRow(uid).remove();
},
has: function(uid) {