diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-04-08 16:23:19 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-04-08 16:29:08 +0200 |
commit | 61e72deca5f7a39ea0b3e4236fc668089c885eee (patch) | |
tree | 363c5b2f4e00c3cddd2fff449483a3f519f2f71c /server/sonar-web/src/main/js/apps/coding-rules | |
parent | 8f77404ca7a821d922a5b3be8197452f1e9cd953 (diff) | |
download | sonarqube-61e72deca5f7a39ea0b3e4236fc668089c885eee.tar.gz sonarqube-61e72deca5f7a39ea0b3e4236fc668089c885eee.zip |
SONAR-7061 Submit buttons are not disabled when activating rules
Diffstat (limited to 'server/sonar-web/src/main/js/apps/coding-rules')
-rw-r--r-- | server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js index 196b11e8d10..67bba2daf14 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js +++ b/server/sonar-web/src/main/js/apps/coding-rules/bulk-change-modal-view.js @@ -69,23 +69,29 @@ export default ModalFormView.extend({ sendRequests (url, options, profiles) { const that = this; let looper = $.Deferred().resolve(); + this.disableForm(); profiles.forEach(function (profile) { const opts = _.extend({}, options, { profile_key: profile }); looper = looper.then(function () { return $.post(url, opts).done(function (r) { - if (r.failed) { - that.showWarnMessage(profile, r.succeeded, r.failed); - } else { - that.showSuccessMessage(profile, r.succeeded); + if (!that.isDestroyed) { + if (r.failed) { + that.showWarnMessage(profile, r.succeeded, r.failed); + } else { + that.showSuccessMessage(profile, r.succeeded); + } } }); }); }); looper.done(function () { that.options.app.controller.fetchList(); - that.$(that.ui.codingRulesSubmitBulkChange.selector).hide(); - that.$('.modal-field').hide(); - that.$('.js-modal-close').focus(); + if (!that.isDestroyed) { + that.$(that.ui.codingRulesSubmitBulkChange.selector).hide(); + that.enableForm(); + that.$('.modal-field').hide(); + that.$('.js-modal-close').focus(); + } }); }, |