summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2016-04-13 15:04:09 +0000
committerJacob Schatz <jschatz1@gmail.com>2016-04-13 15:04:09 +0000
commiteebd7533ea780dade5e953b05c83c7b87f4bbf6f (patch)
tree820102a49d4c77bc39a953c9250e78a8e345cd66
parent34d7619a1c424029ebfb20c19bdaeff67b045891 (diff)
parentde4d98fd120fd43bd744abc116c62708577b5673 (diff)
downloadgitlab-ce-eebd7533ea780dade5e953b05c83c7b87f4bbf6f.tar.gz
Merge branch 'fix-bug-causing-comment-to-submit-twice' into 'master'
Fix bug causing comment form in issue to submit twice when CTRL+Enter is pressed twice See merge request !3655
-rw-r--r--app/assets/javascripts/behaviors/quick_submit.js.coffee6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/behaviors/quick_submit.js.coffee b/app/assets/javascripts/behaviors/quick_submit.js.coffee
index 6e29d374267..3cb96bacaa7 100644
--- a/app/assets/javascripts/behaviors/quick_submit.js.coffee
+++ b/app/assets/javascripts/behaviors/quick_submit.js.coffee
@@ -29,7 +29,11 @@ $(document).on 'keydown.quick_submit', '.js-quick-submit', (e) ->
e.preventDefault()
$form = $(e.target).closest('form')
- $form.find('input[type=submit], button[type=submit]').disable()
+ $submit_button = $form.find('input[type=submit], button[type=submit]')
+
+ return if $submit_button.attr('disabled')
+
+ $submit_button.disable()
$form.submit()
# If the user tabs to a submit button on a `js-quick-submit` form, display a