v1.18.x
barisusakli 11 years ago
parent 31eccb8e7f
commit ce0fdc201a

@ -86,7 +86,7 @@
"topic_will_be_moved_to": "This topic will be moved to the category",
"fork_topic_instruction": "Click the posts you want to fork",
"fork_no_pids": "No posts selected!",
"fork_success": "Succesfully forked topic!",
"fork_success": "Succesfully forked topic! Click here to go to the forked topic.",
"composer.title_placeholder": "Enter your topic title here...",
"composer.discard": "Discard",

@ -42,18 +42,26 @@ define('forum/topic/fork', function() {
socket.emit('topics.createTopicFromPosts', {
title: forkModal.find('#fork-title').val(),
pids: pids
}, function(err) {
}, function(err, newTopic) {
function fadeOutAndRemove(pid) {
$('#post-container li[data-pid="' + pid + '"]').fadeOut(500, function() {
$(this).remove();
});
}
if(err) {
if (err) {
return app.alertError(err.message);
}
app.alertSuccess('[[topic:fork_success]]');
app.alert({
timeout: 5000,
title: '[[global:alert.success]]',
message: '[[topic:fork_success]]',
type: 'success',
clickfn: function() {
ajaxify.go('topic/' + newTopic.slug);
}
});
for(var i=0; i<pids.length; ++i) {
fadeOutAndRemove(pids[i]);

Loading…
Cancel
Save