Commit 544ad086 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

restricted note edit shortcut to only up key

Updated CHANGELOG

Removed CHANGELOG entry

Moved conditional to helper method
parent 9b7fd748
...@@ -102,12 +102,15 @@ class @Notes ...@@ -102,12 +102,15 @@ class @Notes
keydownNoteText: (e) -> keydownNoteText: (e) ->
$this = $(this) $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") myLastNote = $("li.note[data-author-id='#{gon.current_user_id}'][data-editable]:last")
if myLastNote.length if myLastNote.length
myLastNoteEditBtn = myLastNote.find('.js-note-edit') myLastNoteEditBtn = myLastNote.find('.js-note-edit')
myLastNoteEditBtn.trigger('click', [true, myLastNote]) myLastNoteEditBtn.trigger('click', [true, myLastNote])
isMetaKey = (e) ->
(e.metaKey or e.ctrlKey or e.altKey or e.shiftKey)
initRefresh: -> initRefresh: ->
clearInterval(Notes.interval) clearInterval(Notes.interval)
Notes.interval = setInterval => Notes.interval = setInterval =>
......
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