|
|
|
@ -20,7 +20,10 @@ define('forum/topic/move', ['categorySelector', 'alerts'], function (categorySel
|
|
|
|
|
return app.alertError(err.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
parseModal(categories, function () {
|
|
|
|
|
app.parseAndTranslate('partials/move_thread_modal', {
|
|
|
|
|
categories: categories,
|
|
|
|
|
}, function (html) {
|
|
|
|
|
modal = $(html);
|
|
|
|
|
modal.on('hidden.bs.modal', function () {
|
|
|
|
|
modal.remove();
|
|
|
|
|
});
|
|
|
|
@ -39,14 +42,6 @@ define('forum/topic/move', ['categorySelector', 'alerts'], function (categorySel
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function parseModal(categories, callback) {
|
|
|
|
|
app.parseAndTranslate('partials/move_thread_modal', { categories: categories }, function (html) {
|
|
|
|
|
modal = $(html);
|
|
|
|
|
|
|
|
|
|
callback();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onCategorySelected(category) {
|
|
|
|
|
selectedCategory = category;
|
|
|
|
|
modal.find('#move_thread_commit').prop('disabled', false);
|
|
|
|
@ -59,11 +54,16 @@ define('forum/topic/move', ['categorySelector', 'alerts'], function (categorySel
|
|
|
|
|
commitEl.prop('disabled', true);
|
|
|
|
|
|
|
|
|
|
modal.modal('hide');
|
|
|
|
|
|
|
|
|
|
var message = '[[topic:topic_move_success, ' + selectedCategory.name + ']]';
|
|
|
|
|
if (Move.tids && Move.tids.length > 1) {
|
|
|
|
|
message = '[[topic:topic_move_multiple_success, ' + selectedCategory.name + ']]';
|
|
|
|
|
} else if (!Move.tids) {
|
|
|
|
|
message = '[[topic:topic_move_all_success, ' + selectedCategory.name + ']]';
|
|
|
|
|
}
|
|
|
|
|
alerts.alert({
|
|
|
|
|
alert_id: 'tids_move_' + Move.tids.join('-'),
|
|
|
|
|
alert_id: 'tids_move_' + (Move.tids ? Move.tids.join('-') : 'all'),
|
|
|
|
|
title: '[[topic:thread_tools.move]]',
|
|
|
|
|
message: '[[topic:topic_move_success, ' + selectedCategory.name + ']]',
|
|
|
|
|
message: message,
|
|
|
|
|
type: 'success',
|
|
|
|
|
timeout: 10000,
|
|
|
|
|
timeoutfn: function () {
|
|
|
|
|