Skip to content
Snippets Groups Projects
Commit 6fd3c023 authored by Mathias Chouet's avatar Mathias Chouet
Browse files

Verificateur: make jet type selector's disabled state persist after calculation

parent 0310d2db
No related branches found
No related tags found
No related merge requests found
......@@ -30,9 +30,7 @@ export class FormulaireVerificateur extends FormulaireFixedVar {
if (sender.id === "select_target_pass" && data.action === "select") {
// update Verificateur property: Pass to check
this._currentNub.properties.setPropValue("nubToVerify", data.value ? data.value.value : undefined);
// refresh jet type selector
const ntv = (this._currentNub as Verificateur).nubToVerify;
(this.getFormulaireNodeById("select_pab_jet_type") as SelectField).disabled = ! (ntv !== undefined && ntv.calcType === CalculatorType.Pab);
this.refreshJetTypeSelector();
} else if (sender.id === "select_species_list" && data.action === "select") {
// update Verificateur property: Species list (string[])
......@@ -43,4 +41,18 @@ export class FormulaireVerificateur extends FormulaireFixedVar {
}
}
protected compute() {
this.runNubCalc(this.currentNub);
this.reaffectResultComponents();
// do not refreshFieldsets() (useless here) or jet type selector's disabled state will be reset
}
/**
* Disables Jet Type selector if target pass is not a Pab
*/
protected refreshJetTypeSelector() {
const ntv = (this._currentNub as Verificateur).nubToVerify;
(this.getFormulaireNodeById("select_pab_jet_type") as SelectField).disabled = ! (ntv !== undefined && ntv.calcType === CalculatorType.Pab);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment