mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
fix topic move, fix moveAll
move topic wasnt moving mainPid, also fixed crash on move all clicking permissions on admin/categories no longer goes to top of page
This commit is contained in:
@@ -192,10 +192,10 @@ define('forum/admin/categories', ['uploader', 'forum/admin/iconSelect'], functio
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Permissions modal
|
|
||||||
$('.admin-categories').on('click', '.permissions', function() {
|
$('.admin-categories').on('click', '.permissions', function() {
|
||||||
var cid = $(this).parents('li[data-cid]').attr('data-cid');
|
var cid = $(this).parents('li[data-cid]').attr('data-cid');
|
||||||
Categories.launchPermissionsModal(cid);
|
Categories.launchPermissionsModal(cid);
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ define('forum/topic/move', function() {
|
|||||||
modal.on('shown.bs.modal', onMoveModalShown);
|
modal.on('shown.bs.modal', onMoveModalShown);
|
||||||
$('#move-confirm').hide();
|
$('#move-confirm').hide();
|
||||||
|
|
||||||
if (tids.length > 1) {
|
if (Move.moveAll || (tids && tids.length > 1)) {
|
||||||
translator.translate('[[topic:move_topics]]', function(translated) {
|
translator.translate('[[topic:move_topics]]', function(translated) {
|
||||||
modal.find('.modal-header h3').text(translated);
|
modal.find('.modal-header h3').text(translated);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -36,15 +36,24 @@ module.exports = function(Categories) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updatePostCount(tid, oldCid, cid);
|
updatePostCount(tid, oldCid, cid);
|
||||||
|
async.parallel({
|
||||||
topics.getPids(tid, function(err, pids) {
|
mainPid: function(next) {
|
||||||
|
topics.getTopicField(tid, 'mainPid', next);
|
||||||
|
},
|
||||||
|
pids: function(next) {
|
||||||
|
topics.getPids(tid, next);
|
||||||
|
}
|
||||||
|
}, function(err, results) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return winston.error(err.message);
|
return winston.error(err.message);
|
||||||
}
|
}
|
||||||
if (pids && !pids.length) {
|
|
||||||
|
if (!results.mainPid && results.pids && !pids.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var pids = [results.mainPid].concat(results.pids);
|
||||||
|
|
||||||
var keys = pids.map(function(pid) {
|
var keys = pids.map(function(pid) {
|
||||||
return 'post:' + pid;
|
return 'post:' + pid;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user