This commit is contained in:
2025-05-26 21:23:53 -04:00
parent ac207c2e7c
commit d462a55797

View File

@@ -288,7 +288,23 @@ function Build-Checkboxes {
<div id='${($_.Id)}OptionsContainer' style='display:none; margin-top:4px;'> <div id='${($_.Id)}OptionsContainer' style='display:none; margin-top:4px;'>
$subHtml $subHtml
</div> </div>
<script>
document.addEventListener('DOMContentLoaded', function () {
const masterCheckbox = document.getElementById('${($_.Id)}');
const container = document.getElementById('${($_.Id)}OptionsContainer');
if (masterCheckbox && container) {
masterCheckbox.addEventListener('change', function () {
container.style.display = this.checked ? 'block' : 'none';
});
// Auto-show if already checked (e.g. page reload with checkbox checked)
if (masterCheckbox.checked) {
container.style.display = 'block';
}
}
});
</script>
"@ "@
} }
$html $html