comments.js: clean up comment quoting.

Replace Comment.quote with a remote new.js.erb call.
This commit is contained in:
evazion
2018-09-29 12:16:29 -05:00
parent 75232c0cd4
commit 9ac59aeadd
4 changed files with 19 additions and 30 deletions

View File

@@ -0,0 +1,11 @@
var $div = $('div.comments-for-post[data-post-id="<%= @comment.post_id %>"] div.new-comment');
$div.find(".expand-comment-response").click();
var $textarea = $div.find("textarea");
var msg = "<%= j @comment.body %>";
if ($textarea.val().length > 0) {
msg = $textarea.val() + "\n\n" + msg;
}
$textarea.val(msg);
$textarea.selectEnd();