feat: add undoTimeout to moving posts as well #9599

v1.18.x
psychobunny 4 years ago
parent 05cc7ccb60
commit e588948ff5

@ -44,21 +44,25 @@ define('forum/topic/move-post', [
pids: postSelect.pids.slice(), pids: postSelect.pids.slice(),
tid: targetTid, tid: targetTid,
}; };
alerts.alert({ if (config.undoTimeout > 0) {
alert_id: 'pids_move_' + postSelect.pids.join('-'), return alerts.alert({
title: '[[topic:thread_tools.move-posts]]', alert_id: 'pids_move_' + postSelect.pids.join('-'),
message: '[[topic:topic_move_posts_success]]', title: '[[topic:thread_tools.move-posts]]',
type: 'success', message: '[[topic:topic_move_posts_success]]',
timeout: 10000, type: 'success',
timeoutfn: function () { timeout: 10000,
movePosts(data); timeoutfn: function () {
}, movePosts(data);
clickfn: function (alert, params) { },
delete params.timeoutfn; clickfn: function (alert, params) {
app.alertSuccess('[[topic:topic_move_posts_undone]]'); delete params.timeoutfn;
moveCommit.removeAttr('disabled'); app.alertSuccess('[[topic:topic_move_posts_undone]]');
}, moveCommit.removeAttr('disabled');
}); },
});
}
movePosts(data);
}); });
}); });
}; };

Loading…
Cancel
Save