mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
add remove user from group confirmation
Added confirmation request when removing user from a group.
This commit is contained in:
@@ -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,7 +172,8 @@ define(function() {
|
||||
groupMembersEl.on('click', 'li[data-uid]', function() {
|
||||
var uid = this.getAttribute('data-uid'),
|
||||
gid = detailsModal.attr('data-gid');
|
||||
|
||||
bootbox.confirm('Are you sure you want to remove this user?', function(confirm) {
|
||||
if (confirm){
|
||||
socket.emit('admin.groups.leave', {
|
||||
gid: gid,
|
||||
uid: uid
|
||||
@@ -180,6 +182,8 @@ define(function() {
|
||||
groupMembersEl.find('li[data-uid="' + uid + '"]').remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
detailsModalSave.on('click', function() {
|
||||
|
||||
@@ -96,3 +96,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" template-variable="yourid" value="{yourid}" />
|
||||
@@ -429,7 +429,8 @@ var nconf = require('nconf'),
|
||||
expand: true
|
||||
}, function (err, groups) {
|
||||
res.json(200, {
|
||||
groups: groups
|
||||
groups: groups,
|
||||
yourid: req.user.uid
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user