summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-04-15 16:36:25 -0400
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-04-15 16:36:25 -0400
commit262ca7b651037e02d0de662b6462fe4edfa77e81 (patch)
tree72607212fa1068ed958bed38a2ff0c44a1692cae
parentf2d94c5d8627adee985e605a18cf147003ef16de (diff)
downloadgitlab-ce-262ca7b651037e02d0de662b6462fe4edfa77e81.tar.gz
When editing put the cursor at the end of the textarea
-rw-r--r--app/assets/javascripts/notes.js.coffee6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index a3d0d212bed..c2e103ff857 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -374,7 +374,11 @@ class @Notes
$('html, body').animate({
scrollTop: myLastNote.offset().top - 150
}, 500, ->
- form.find(".js-note-text").focus()
+ $noteText = form.find(".js-note-text")
+ $noteText.focus()
+ # Neat little trick to put the cursor at the end
+ noteTextVal = $noteText.val()
+ $noteText.val('').val(noteTextVal);
);
else
form.find(".js-note-text").focus()