mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
fix: copy settings showing empty category selection
This commit is contained in:
@@ -124,8 +124,13 @@ define('admin/manage/category', [
|
||||
});
|
||||
|
||||
$('.copy-settings').on('click', function () {
|
||||
socket.emit('categories.getSelectCategories', {}, function (err, allCategories) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
Benchpress.parse('admin/partials/categories/copy-settings', {
|
||||
categories: ajaxify.data.allCategories,
|
||||
categories: allCategories,
|
||||
}, function (html) {
|
||||
var selectedCid;
|
||||
var modal = bootbox.dialog({
|
||||
@@ -136,7 +141,7 @@ define('admin/manage/category', [
|
||||
label: '[[modules:bootbox.confirm]]',
|
||||
className: 'btn-primary',
|
||||
callback: function () {
|
||||
if (!selectedCid) {
|
||||
if (!selectedCid || parseInt(selectedCid, 10) === parseInt(ajaxify.data.category.cid, 10)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -168,6 +173,7 @@ define('admin/manage/category', [
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$('.upload-button').on('click', function () {
|
||||
var inputEl = $(this);
|
||||
|
||||
Reference in New Issue
Block a user