Merge branch 'ctr-enter-textarea-mac' into 'master'

ctrl+enter on mac correctly submits forms

Closes #4177

See merge request !3089
This commit is contained in:
Jacob Schatz 2016-03-04 20:29:04 +00:00
commit ec68d673b2

View file

@ -24,10 +24,7 @@ keyCodeIs = (e, keyCode) ->
$(document).on 'keydown.quick_submit', '.js-quick-submit', (e) -> $(document).on 'keydown.quick_submit', '.js-quick-submit', (e) ->
return unless keyCodeIs(e, 13) # Enter return unless keyCodeIs(e, 13) # Enter
if isMac() return unless (e.metaKey && !e.altKey && !e.ctrlKey && !e.shiftKey) || (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey)
return unless (e.metaKey && !e.altKey && !e.ctrlKey && !e.shiftKey)
else
return unless (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey)
e.preventDefault() e.preventDefault()