add remove user from group confirmation

Added confirmation request when removing user from a group.
This commit is contained in:
Josh
2014-01-20 20:28:46 +00:00
parent 663aff4b24
commit f14ad11dd0
3 changed files with 15 additions and 9 deletions

View File

@@ -2,7 +2,8 @@ define(function() {
var Groups = {};
Groups.init = function() {
var createEl = document.getElementById('create'),
var yourid = templates.get('yourid'),
createEl = document.getElementById('create'),
createModal = $('#create-modal'),
createSubmitBtn = document.getElementById('create-modal-go'),
createNameEl = $('#create-group-name'),
@@ -171,13 +172,16 @@ 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();
}
});
}
});
});