mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +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 () {
|
$('.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', {
|
Benchpress.parse('admin/partials/categories/copy-settings', {
|
||||||
categories: ajaxify.data.allCategories,
|
categories: allCategories,
|
||||||
}, function (html) {
|
}, function (html) {
|
||||||
var selectedCid;
|
var selectedCid;
|
||||||
var modal = bootbox.dialog({
|
var modal = bootbox.dialog({
|
||||||
@@ -136,7 +141,7 @@ define('admin/manage/category', [
|
|||||||
label: '[[modules:bootbox.confirm]]',
|
label: '[[modules:bootbox.confirm]]',
|
||||||
className: 'btn-primary',
|
className: 'btn-primary',
|
||||||
callback: function () {
|
callback: function () {
|
||||||
if (!selectedCid) {
|
if (!selectedCid || parseInt(selectedCid, 10) === parseInt(ajaxify.data.category.cid, 10)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +173,7 @@ define('admin/manage/category', [
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$('.upload-button').on('click', function () {
|
$('.upload-button').on('click', function () {
|
||||||
var inputEl = $(this);
|
var inputEl = $(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user