diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2018-03-21 14:28:39 -0400 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2018-03-21 14:28:39 -0400 |
commit | 32ce1e3a00149f3dea00d4e65c6e5e7d7b5862f5 (patch) | |
tree | 86a51bd1d9090d0b7f7145dd1dc243234f7f7eaf | |
parent | 2025f361e7520e00962f6964aa77c4f4e6c3d56b (diff) | |
download | gitlab-ce-32ce1e3a00149f3dea00d4e65c6e5e7d7b5862f5.tar.gz |
Disables the button when submitting comment.
-rw-r--r-- | app/assets/javascripts/notes.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 2afa4e4c1bf..09f0ea37103 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -1727,6 +1727,7 @@ export default class Notes { // Get Form metadata const $submitBtn = $(e.target); + $submitBtn.prop('disabled', true); let $form = $submitBtn.parents('form'); const $closeBtn = $form.find('.js-note-target-close'); const isDiscussionNote = @@ -1761,7 +1762,6 @@ export default class Notes { // If comment is to resolve discussion, disable submit buttons while // comment posting is finished. if (isDiscussionResolve) { - $submitBtn.disable(); $form.find('.js-comment-submit-button').disable(); } @@ -1816,6 +1816,7 @@ export default class Notes { .then(res => { const note = res.data; + $submitBtn.prop('disabled', false); // Submission successful! remove placeholder $notesContainer.find(`#${noteUniqueId}`).remove(); @@ -1899,7 +1900,7 @@ export default class Notes { .catch(() => { // Submission failed, remove placeholder note and show Flash error message $notesContainer.find(`#${noteUniqueId}`).remove(); - + $submitBtn.prop('disabled', false); const blurEvent = new CustomEvent('blur.imageDiff', { detail: e, }); |