diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-11 14:20:51 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-11 14:21:11 +0300 |
commit | d909ae73dc5bca391e6639af0d8f9fcacb7a00ea (patch) | |
tree | a0be4a2a48647c624aa2cefa545991016cc9ad7e /app | |
parent | 367dee33e260fec07c6ebaf4e10b76e6dcda816d (diff) |
Actually submit comment on command-enter.
Resolves #1869.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 37a7b31d3c8..47c5ecdedf1 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -58,7 +58,8 @@ class @Notes $(document).on "visibilitychange", @visibilityChange @notes_forms = '.js-main-target-form textarea, .js-discussion-note-form textarea' - $(document).on('keypress', @notes_forms, (e)-> + # Chrome doesn't fire keypress or keyup for Command+Enter, so we need keydown. + $(document).on('keydown', @notes_forms, (e) -> if e.keyCode == 10 || ((e.metaKey || e.ctrlKey) && e.keyCode == 13) $(@).parents('form').submit() ) |