From: Stas Vilchik Date: Wed, 3 Jun 2015 07:46:56 +0000 (+0200) Subject: SONAR-6449 disable issues comment form during request X-Git-Tag: 5.2-RC1~1672 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ccf24581e2de42c829513b6270eac15bb0c0e9e7;p=sonarqube.git SONAR-6449 disable issues comment form during request --- diff --git a/server/sonar-web/src/main/js/components/issue/views/comment-form-view.js b/server/sonar-web/src/main/js/components/issue/views/comment-form-view.js index 4816ff2eada..8596d99223a 100644 --- a/server/sonar-web/src/main/js/components/issue/views/comment-form-view.js +++ b/server/sonar-web/src/main/js/components/issue/views/comment-form-view.js @@ -49,6 +49,14 @@ define([ this.options.detailView.updateAfterAction(false); }, + disableForm: function () { + this.$(':input').prop('disabled', true); + }, + + enableForm: function () { + this.$(':input').prop('disabled', false); + }, + submit: function () { var that = this; var text = this.ui.textarea.val(), @@ -61,9 +69,13 @@ define([ } else { data.issue = this.options.issue.id; } - return $.post(url, data).done(function () { - that.options.detailView.updateAfterAction(true); - }); + this.disableForm(); + return $.post(url, data) + .done(function () { + that.options.detailView.updateAfterAction(true); + }).fail(function () { + that.enableForm(); + }); } });