Through to row 87

This commit is contained in:
2018-11-24 16:54:39 +00:00
parent 90f05fc92a
commit 5c4e9c330d
3 changed files with 146 additions and 48 deletions

View File

@ -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>