restricted note edit shortcut to only up key
Updated CHANGELOG Removed CHANGELOG entry Moved conditional to helper method
This commit is contained in:
parent
9b7fd74805
commit
544ad086da
1 changed files with 4 additions and 1 deletions
|
@ -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 =>
|
||||
|
|
Loading…
Reference in a new issue