Merge pull request #822 from BitBangersCode/admin-fix

Confirmation when removing user from a group
v1.18.x
Barış Soner Uşaklı 11 years ago
commit 94f38d0622

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

@ -95,4 +95,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
Loading…
Cancel
Save