]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 711655 - 'reply' JS should insert at caret position
authorAnamika_07 <h2014313059@hyderabad.bits-pilani.ac.in>
Tue, 11 Oct 2016 22:56:07 +0000 (18:56 -0400)
committerDylan William Hardison <dylan@hardison.net>
Tue, 11 Oct 2016 22:56:07 +0000 (18:56 -0400)
r=dylan

js/comments.js

index 30baf53f4b13fcf2d707a7ab740d6047b5a306bc..0cc4fb9eb499254d68f8429ae7d65e3ff4a14d85 100644 (file)
@@ -29,8 +29,8 @@ function replyToComment(id, real_id, replyto_header, text) {
 
     /* <textarea id="comment"> */
     var textarea = document.getElementById('comment');
-    if (textarea.value != replytext) {
-        textarea.value += replytext;
+    if (!textarea.value.startsWith(replytext)) {
+        textarea.value = replytext+"\n"+textarea.value;
     }
 
     textarea.focus();