diff options
author | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-04-15 16:36:25 -0400 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-04-15 16:36:25 -0400 |
commit | 262ca7b651037e02d0de662b6462fe4edfa77e81 (patch) | |
tree | 72607212fa1068ed958bed38a2ff0c44a1692cae | |
parent | f2d94c5d8627adee985e605a18cf147003ef16de (diff) | |
download | gitlab-ce-262ca7b651037e02d0de662b6462fe4edfa77e81.tar.gz |
When editing put the cursor at the end of the textarea
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 6 |
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() |