UI: add condition to setter disabled

This commit is contained in:
Artem Dzhereleiko 2023-09-01 11:35:11 +03:00
parent bdc7525ac4
commit f3c7a053ea

View File

@ -101,13 +101,17 @@ export abstract class RuleNodeConfigurationComponent extends PageComponent imple
configurationValue: RuleNodeConfiguration; configurationValue: RuleNodeConfiguration;
private configurationSet = false; private configurationSet = false;
private disabledValue = false;
set disabled(value: boolean) { set disabled(value: boolean) {
if (value) { if (this.disabledValue !== value) {
this.configForm().disable({emitEvent: false}); this.disabledValue = value;
} else { if (value) {
this.configForm().enable({emitEvent: false}); this.configForm().disable({emitEvent: false});
this.updateValidators(false); } else {
this.configForm().enable({emitEvent: false});
this.updateValidators(false);
}
} }
}; };