Commit 7a70fb12 authored by Douwe Maan's avatar Douwe Maan

Prevent holding Control-Enter or Command-Enter from posting comment multiple times.

parent 28592ae4
......@@ -46,6 +46,7 @@ v 7.10.0 (unreleased)
- Refactor issue filtering
- AJAX selectbox for issue assignee and author filters
- Fix issue with missing options in issue filtering dropdown if selected one
- Prevent holding Control-Enter or Command-Enter from posting comment multiple times.
v 7.9.0
- Send EmailsOnPush email when branch or tag is created or deleted.
......
......@@ -57,6 +57,7 @@ class @Notes
@notes_forms = '.js-main-target-form textarea, .js-discussion-note-form textarea'
# Chrome doesn't fire keypress or keyup for Command+Enter, so we need keydown.
$(document).on('keydown', @notes_forms, (e) ->
return if e.originalEvent.repeat
if e.keyCode == 10 || ((e.metaKey || e.ctrlKey) && e.keyCode == 13)
$(@).parents('form').submit()
)
......
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