diff options
author | kushalpandya <kushal@gitlab.com> | 2017-05-30 14:28:09 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-06-01 08:47:16 +0300 |
commit | f57a4a945a60bd41d46d3253178bff7b1879799f (patch) | |
tree | d7a6050a466ec96d6717f43664c676a2967a8dda /app/assets/javascripts/integrations | |
parent | 4341801a416a30319cdf646c647b03b629491e05 (diff) |
Add comments for method and minor refinements
Diffstat (limited to 'app/assets/javascripts/integrations')
-rw-r--r-- | app/assets/javascripts/integrations/integration_settings_form.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/integrations/integration_settings_form.js b/app/assets/javascripts/integrations/integration_settings_form.js index 5ecab0b11a2..5745475123d 100644 --- a/app/assets/javascripts/integrations/integration_settings_form.js +++ b/app/assets/javascripts/integrations/integration_settings_form.js @@ -44,6 +44,9 @@ export default class IntegrationSettingsForm { this.toggleServiceState($(e.currentTarget).is(':checked')); } + /** + * Change Form's validation enforcement based on service status (active/inactive) + */ toggleServiceState(serviceActive) { this.toggleSubmitBtnLabel(serviceActive, this.canTestService); if (serviceActive) { @@ -54,7 +57,7 @@ export default class IntegrationSettingsForm { } /** - * Toggle Submit button label based on Integration status + * Toggle Submit button label based on Integration status and ability to test service */ toggleSubmitBtnLabel(serviceActive, canTestService) { this.$submitBtnLabel.text( @@ -76,7 +79,9 @@ export default class IntegrationSettingsForm { this.$submitBtnLoader.removeClass('hidden'); } else { this.$submitBtn.enable(); - this.$submitBtnLoader.addClass('hidden'); + if (!this.$submitBtnLoader.hasClass('hidden')) { + this.$submitBtnLoader.addClass('hidden'); + } } } |