mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: undo for posts move
This commit is contained in:
@@ -91,8 +91,10 @@
|
|||||||
"thread_tools.merge_topics": "Merge Topics",
|
"thread_tools.merge_topics": "Merge Topics",
|
||||||
"thread_tools.merge": "Merge",
|
"thread_tools.merge": "Merge",
|
||||||
|
|
||||||
"topic_move_success": "This topic has been successfully moved to %1. Click here to undo.",
|
"topic_move_success": "This topic will be moved shortly. Click here to undo.",
|
||||||
"topic_move_undone": "Topic move undone",
|
"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",
|
||||||
|
|
||||||
"post_delete_confirm": "Are you sure you want to delete this post?",
|
"post_delete_confirm": "Are you sure you want to delete this post?",
|
||||||
"post_restore_confirm": "Are you sure you want to restore this post?",
|
"post_restore_confirm": "Are you sure you want to restore this post?",
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
|
|
||||||
define('forum/topic/move-post', [
|
define('forum/topic/move-post', [
|
||||||
'components', 'postSelect', 'translator',
|
'components', 'postSelect', 'translator', 'alerts',
|
||||||
], function (components, postSelect, translator) {
|
], function (components, postSelect, translator, alerts) {
|
||||||
var MovePost = {};
|
var MovePost = {};
|
||||||
|
|
||||||
var moveModal;
|
var moveModal;
|
||||||
@@ -34,7 +34,23 @@ define('forum/topic/move-post', [
|
|||||||
.on('action:ajaxify.end', checkMoveButtonEnable);
|
.on('action:ajaxify.end', checkMoveButtonEnable);
|
||||||
|
|
||||||
moveCommit.on('click', function () {
|
moveCommit.on('click', function () {
|
||||||
movePosts();
|
moveCommit.attr('disabled', true);
|
||||||
|
|
||||||
|
alerts.alert({
|
||||||
|
alert_id: 'pids_move_' + postSelect.pids.join('-'),
|
||||||
|
title: '[[topic:thread_tools.move-posts]]',
|
||||||
|
message: '[[topic:topic_move_posts_success]]',
|
||||||
|
type: 'success',
|
||||||
|
timeout: 10000,
|
||||||
|
timeoutfn: function () {
|
||||||
|
movePosts();
|
||||||
|
},
|
||||||
|
clickfn: function (alert, params) {
|
||||||
|
delete params.timeoutfn;
|
||||||
|
app.alertSuccess('[[topic:topic_move_posts_undone]]');
|
||||||
|
moveCommit.removeAttr('disabled');
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user