mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 07:40:43 +01:00
add support to set parentCid to 0
This commit is contained in:
@@ -239,6 +239,21 @@ define('forum/admin/categories', ['uploader', 'forum/admin/iconSelect'], functio
|
||||
modal.find('select').val($(this).attr('data-parentCid'));
|
||||
modal.attr('data-cid', cid).modal();
|
||||
});
|
||||
|
||||
$('button[data-action="removeParent"]').on('click', function() {
|
||||
var cid = $(this).parents('[data-cid]').attr('data-cid');
|
||||
var payload= {};
|
||||
payload[cid] = {
|
||||
parentCid: 0
|
||||
};
|
||||
socket.emit('admin.categories.update', payload, function(err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
ajaxify.go('admin/categories/active');
|
||||
});
|
||||
});
|
||||
|
||||
$('#setParent [data-cid]').on('click', function() {
|
||||
var modalEl = $('#setParent'),
|
||||
parentCid = $(this).attr('data-cid'),
|
||||
|
||||
Reference in New Issue
Block a user