Node.js based forum software built for the modern web
fix: #8779, fix move all
Barış Soner Uşaklıe6440c0d2157
diff --git a/public/language/en-GB/topic.json b/public/language/en-GB/topic.jsonindex 8292feb461..e56cefe728 100644--- a/public/language/en-GB/topic.json+++ b/public/language/en-GB/topic.json@@ -91,7 +91,9 @@"thread_tools.merge_topics": "Merge Topics","thread_tools.merge": "Merge",- "topic_move_success": "This topic will be moved shortly. Click here to undo.",+ "topic_move_success": "This topic will be moved to \"%1\" shortly. Click here to undo.",+ "topic_move_multiple_success": "These topics will be moved to \"%1\" shortly. Click here to undo.",+ "topic_move_all_success": "All topics will be moved to \"%1\" shortly. Click here to undo.","topic_move_undone": "Topic move undone","topic_move_posts_success": "Posts will be moved shortly. Click here to undo.","topic_move_posts_undone": "Post move undone",diff --git a/public/src/client/topic/move.js b/public/src/client/topic/move.jsindex 9474be59a0..706ca635f8 100644--- a/public/src/client/topic/move.js+++ b/public/src/client/topic/move.js@@ -20,7 +20,10 @@ define('forum/topic/move', ['categorySelector', 'alerts'], function (categorySelreturn 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 (categorySelcommitEl.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 () {