summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-03-21 23:23:42 +0000
committerFatih Acet <acetfatih@gmail.com>2018-03-21 23:23:42 +0000
commit5d47ddc79803314b99fe7f78b4928a5411950b50 (patch)
tree123d60b4fdac79d803758dbe65578d995e6497eb /app
parent03bbd847deb16330d0e35ce662c282b539eef9eb (diff)
parente1213ff6ae1750f7b08caed73089e3ffb0951c73 (diff)
downloadgitlab-ce-5d47ddc79803314b99fe7f78b4928a5411950b50.tar.gz
Merge branch 'disable-btn-mr-when-posting-comment' into 'master'
Disables the button when submitting comment. Closes #39661 See merge request gitlab-org/gitlab-ce!17918
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes.js5
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,
});