summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/integrations
diff options
context:
space:
mode:
authorkushalpandya <kushal@gitlab.com>2017-05-30 16:58:09 +0530
committerJarka Kadlecova <jarka@gitlab.com>2017-06-01 07:47:16 +0200
commitf57a4a945a60bd41d46d3253178bff7b1879799f (patch)
treed7a6050a466ec96d6717f43664c676a2967a8dda /app/assets/javascripts/integrations
parent4341801a416a30319cdf646c647b03b629491e05 (diff)
downloadgitlab-ce-f57a4a945a60bd41d46d3253178bff7b1879799f.tar.gz
Add comments for method and minor refinements
Diffstat (limited to 'app/assets/javascripts/integrations')
-rw-r--r--app/assets/javascripts/integrations/integration_settings_form.js9
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');
+ }
}
}