restricted note edit shortcut to only up key

Updated CHANGELOG

Removed CHANGELOG entry

Moved conditional to helper method
This commit is contained in:
Luke "Jared" Bennett 2016-06-09 17:34:03 +01:00
parent 9b7fd74805
commit 544ad086da
No known key found for this signature in database
GPG key ID: 8B91010378F2851F

View file

@ -102,12 +102,15 @@ class @Notes
keydownNoteText: (e) ->
$this = $(this)
if $this.val() is '' and e.which is 38 #aka the up key
if $this.val() is '' and e.which is 38 and not isMetaKey e
myLastNote = $("li.note[data-author-id='#{gon.current_user_id}'][data-editable]:last")
if myLastNote.length
myLastNoteEditBtn = myLastNote.find('.js-note-edit')
myLastNoteEditBtn.trigger('click', [true, myLastNote])
isMetaKey = (e) ->
(e.metaKey or e.ctrlKey or e.altKey or e.shiftKey)
initRefresh: ->
clearInterval(Notes.interval)
Notes.interval = setInterval =>