v1.18.x
barisusakli 10 years ago
parent edba11f388
commit cf36f7bc79

@ -139,10 +139,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
selection = window.getSelection ? window.getSelection() : document.selection.createRange(); selection = window.getSelection ? window.getSelection() : document.selection.createRange();
if ($(selection.baseNode).parents('[component="post/content"]').length > 0) { if ($(selection.baseNode).parents('[component="post/content"]').length > 0) {
var snippet = selection.toString(); selectionText = selection.toString();
if (snippet.length) {
selectionText = '> ' + snippet.replace(/\n/g, '\n> ') + '\n\n';
}
} }
var username = getUserName(selectionText ? $(selection.baseNode) : button); var username = getUserName(selectionText ? $(selection.baseNode) : button);
@ -177,10 +174,6 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
if(err) { if(err) {
return app.alertError(err.message); return app.alertError(err.message);
} }
var quoted = '';
if(post) {
quoted = '> ' + post.replace(/\n/g, '\n> ') + '\n\n';
}
$(window).trigger('action:composer.addQuote', { $(window).trigger('action:composer.addQuote', {
tid: tid, tid: tid,
@ -189,7 +182,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
pid: pid, pid: pid,
username: username, username: username,
topicName: topicName, topicName: topicName,
text: quoted text: post
}); });
}); });
} }

Loading…
Cancel
Save