Through to row 87
This commit is contained in:
@ -137,6 +137,34 @@
|
||||
});
|
||||
}
|
||||
|
||||
var analysisToggles = [
|
||||
{
|
||||
"input": "id_id_sector_of_economy_0_1",
|
||||
"section": "power_generation_questions",
|
||||
},
|
||||
{
|
||||
"input": "id_id_sector_of_economy_0_2",
|
||||
"section": "power_grids_energy_storage_questions",
|
||||
},
|
||||
{
|
||||
"input": "id_id_sector_of_economy_0_3",
|
||||
"section": "mineral_commodity_questions",
|
||||
},
|
||||
]
|
||||
|
||||
function showAnalysisSection() {
|
||||
for (const option of analysisToggles) {
|
||||
const input = document.getElementById(option.input)
|
||||
const section = document.getElementById(option.section)
|
||||
|
||||
if (input.checked) {
|
||||
$(section).show();
|
||||
} else {
|
||||
$(section).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Helper functions
|
||||
function show(tag) {
|
||||
$(tag).show();
|
||||
@ -180,6 +208,13 @@
|
||||
conditionalCheckboxes.forEach(function(item){
|
||||
$(item.checkbox).change();
|
||||
});
|
||||
|
||||
for (const option of analysisToggles) {
|
||||
const input = document.getElementById(option.input)
|
||||
|
||||
$(input).on('change', showAnalysisSection);
|
||||
$(input).trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user