From 692773c5a0a8e203442e119b57ae32adf25de67e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 4 Mar 2016 10:11:15 +0000 Subject: [PATCH] ctrl+enter on mac correctly submits forms Closes #4177 --- app/assets/javascripts/behaviors/quick_submit.js.coffee | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/assets/javascripts/behaviors/quick_submit.js.coffee b/app/assets/javascripts/behaviors/quick_submit.js.coffee index 61c2e4f698c..6e29d374267 100644 --- a/app/assets/javascripts/behaviors/quick_submit.js.coffee +++ b/app/assets/javascripts/behaviors/quick_submit.js.coffee @@ -24,10 +24,7 @@ keyCodeIs = (e, keyCode) -> $(document).on 'keydown.quick_submit', '.js-quick-submit', (e) -> return unless keyCodeIs(e, 13) # Enter - if isMac() - return unless (e.metaKey && !e.altKey && !e.ctrlKey && !e.shiftKey) - else - return unless (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey) + return unless (e.metaKey && !e.altKey && !e.ctrlKey && !e.shiftKey) || (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey) e.preventDefault()