Commit dd047865 authored by Jacob Schatz's avatar Jacob Schatz

Add move cursor to last character for editing comment also.

parent 262ca7b6
......@@ -366,6 +366,11 @@ class @Notes
# Show the attachment delete link
note.find(".js-note-attachment-delete").show()
done = ($noteText) ->
# Neat little trick to put the cursor at the end
noteTextVal = $noteText.val()
$noteText.val('').val(noteTextVal);
new GLForm form
if scrollTo? and myLastNote?
# scroll to the bottom
......@@ -376,12 +381,12 @@ class @Notes
}, 500, ->
$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);
done($noteText)
);
else
form.find(".js-note-text").focus()
$noteText = form.find('.js-note-text')
$noteText.focus()
done($noteText)
###
Called in response to clicking the edit note link
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment