Commit f57a4a94 authored by kushalpandya's avatar kushalpandya Committed by Jarka Kadlecova

Add comments for method and minor refinements

parent 4341801a
......@@ -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');
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment