Merge pull request #822 from BitBangersCode/admin-fix

Confirmation when removing user from a group
This commit is contained in:
Barış Soner Uşaklı
2014-01-20 13:18:52 -08:00
2 changed files with 12 additions and 8 deletions

View File

@@ -171,13 +171,17 @@ define(function() {
groupMembersEl.on('click', 'li[data-uid]', function() {
var uid = this.getAttribute('data-uid'),
gid = detailsModal.attr('data-gid');
socket.emit('admin.groups.leave', {
gid: gid,
uid: uid
}, function(err, data) {
if (!err) {
groupMembersEl.find('li[data-uid="' + uid + '"]').remove();
bootbox.confirm('Are you sure you want to remove this user?', function(confirm) {
if (confirm){
socket.emit('admin.groups.leave', {
gid: gid,
uid: uid
}, function(err, data) {
if (!err) {
groupMembersEl.find('li[data-uid="' + uid + '"]').remove();
}
});
}
});
});

View File

@@ -95,4 +95,4 @@
</div>
</div>
</div>
</div>
</div>