diff options
author | Arinde Eniola <eniolaarinde1@gmail.com> | 2016-04-11 17:19:11 +0300 |
---|---|---|
committer | Arinde Eniola <eniolaarinde1@gmail.com> | 2016-04-11 17:19:11 +0300 |
commit | de4d98fd120fd43bd744abc116c62708577b5673 (patch) | |
tree | e62c030f70b301203075b6d657cfd5c628d12956 /app/assets/javascripts/behaviors | |
parent | 5999fec7a3aa7f663d0ade254e37fda3391fa17a (diff) |
fix bug causing comment form in issue to submit twice when CTRL+Enter is pressed twice
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/quick_submit.js.coffee | 6 |
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 |