diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-06-03 09:46:56 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-06-03 09:47:04 +0200 |
commit | ccf24581e2de42c829513b6270eac15bb0c0e9e7 (patch) | |
tree | e9dd5e2c64e59f1586af007025950db071e9335a /server | |
parent | 8e66ba448c3c77bff89d9139fa6e4c8b5d7e91a6 (diff) | |
download | sonarqube-ccf24581e2de42c829513b6270eac15bb0c0e9e7.tar.gz sonarqube-ccf24581e2de42c829513b6270eac15bb0c0e9e7.zip |
SONAR-6449 disable issues comment form during request
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/src/main/js/components/issue/views/comment-form-view.js | 18 |
1 files changed, 15 insertions, 3 deletions
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(); + }); } }); |