From cc3150ff092bcc496e9b39427719c027bb8a8fef Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 3 Apr 2014 18:07:31 -0400 Subject: [PATCH] closes #1316 --- public/src/forum/topic/postTools.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/src/forum/topic/postTools.js b/public/src/forum/topic/postTools.js index 399095b9c0..05b859d770 100644 --- a/public/src/forum/topic/postTools.js +++ b/public/src/forum/topic/postTools.js @@ -69,15 +69,19 @@ define(['composer', 'share'], function(composer, share) { if ($(selection.baseNode).parents('.post-content').length > 0) { var snippet = selection.toString(); - if (snippet.length > 0) { - selectionText = '> ' + snippet.replace(/\n/g, '\n> '); + if (snippet.length) { + selectionText = '> ' + snippet.replace(/\n/g, '\n> ') + '\n\n'; } } var username = getUserName(button); - username += username ? ' ' : ''; - composer.newReply(tid, getPid(button), topicName, selectionText.length > 0 ? selectionText + '\n\n' + username : '' + username); + if (selectionText.length) { + composer.addQuote(tid, getPid(button), topicName, username, selectionText); + } else { + composer.newReply(tid, getPid(button), topicName, username + ' '); + } + } function onQuoteClicked(button, tid, topicName) {