attempt #2
This commit is contained in:
@@ -285,10 +285,26 @@ function Build-Checkboxes {
|
|||||||
) -join "`n"
|
) -join "`n"
|
||||||
|
|
||||||
$html += @"
|
$html += @"
|
||||||
<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
|
||||||
|
|||||||
Reference in New Issue
Block a user