mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
feat: add undoTimeout to moving posts as well #9599
This commit is contained in:
@@ -44,21 +44,25 @@ define('forum/topic/move-post', [
|
||||
pids: postSelect.pids.slice(),
|
||||
tid: targetTid,
|
||||
};
|
||||
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(data);
|
||||
},
|
||||
clickfn: function (alert, params) {
|
||||
delete params.timeoutfn;
|
||||
app.alertSuccess('[[topic:topic_move_posts_undone]]');
|
||||
moveCommit.removeAttr('disabled');
|
||||
},
|
||||
});
|
||||
if (config.undoTimeout > 0) {
|
||||
return 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(data);
|
||||
},
|
||||
clickfn: function (alert, params) {
|
||||
delete params.timeoutfn;
|
||||
app.alertSuccess('[[topic:topic_move_posts_undone]]');
|
||||
moveCommit.removeAttr('disabled');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
movePosts(data);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user