From a68242345b2e09943bc5c37ae1180c48d9e213e6 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 01 2018 09:00:29 +0000 Subject: When citing a comment, append the citation rather than replace the whole comment Fixes https://pagure.io/pagure/issue/3135 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index 2b3ae9e..da6bfe9 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -595,7 +595,11 @@ function setup_reply_btns() { for (cnt = 0; cnt < _text.length ; cnt ++) { _output[cnt] = '> ' + $.trim(_text[cnt]); } - $( "#comment" ).val(_output.join("\n")); + var _prev = $( "#comment" ).val(); + if (_prev.length > 0){ + _prev += "\n\n"; + } + $( "#comment" ).val(_prev + _output.join("\n")); } ).click(function(){ $('html, body').animate({ diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index cb345ff..a09d1cf 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -1045,7 +1045,11 @@ function setup_reply_btns() { for (var cnt=0; cnt < _text.length; cnt++) { _output[cnt] = '> ' + _text[cnt]; } - $( "#comment" ).val(_output.join("\n")); + var _prev = $( "#comment" ).val(); + if (_prev.length > 0){ + _prev += "\n\n"; + } + $( "#comment" ).val(_prev + _output.join("\n")); } ); };