When editing put the cursor at the end of the textarea

This commit is contained in:
Jacob Schatz 2016-04-15 16:36:25 -04:00
parent f2d94c5d86
commit 262ca7b651
1 changed files with 5 additions and 1 deletions

View File

@ -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()