attempt to get the password field to show up
This commit is contained in:
@@ -274,7 +274,6 @@ function Build-Checkboxes {
|
||||
if ($_.SubOptions) {
|
||||
Write-Host "👉 Rendering SubOptions for task $taskId"
|
||||
|
||||
# Build the sub-checkboxes
|
||||
$subHtml = (
|
||||
$_.SubOptions | ForEach-Object {
|
||||
"<label style='margin-left:20px; display:block;'>
|
||||
@@ -283,15 +282,14 @@ function Build-Checkboxes {
|
||||
}
|
||||
) -join "`n"
|
||||
|
||||
# Append HTML + inline script
|
||||
$html += @"
|
||||
<div id='${taskId}OptionsContainer' style='display:none; margin-top:4px;'>
|
||||
$subHtml
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const masterCheckbox = document.getElementById('${($_.Id)}');
|
||||
const container = document.getElementById('${($_.Id)}OptionsContainer');
|
||||
(function() {
|
||||
const masterCheckbox = document.getElementById('${taskId}');
|
||||
const container = document.getElementById('${taskId}OptionsContainer');
|
||||
|
||||
if (masterCheckbox && container) {
|
||||
const passwordContainer = document.getElementById("PasswordContainer");
|
||||
@@ -299,21 +297,17 @@ $subHtml
|
||||
|
||||
function updateDisplay(checked) {
|
||||
container.style.display = checked ? 'block' : 'none';
|
||||
container.querySelectorAll('input[type="checkbox"]').forEach(cb => cb.checked = checked);
|
||||
|
||||
if (passwordContainer) passwordContainer.style.display = checked ? 'block' : 'none';
|
||||
if (dattoContainer) dattoContainer.style.display = checked ? 'block' : 'none';
|
||||
container.querySelectorAll('input[type="checkbox"]').forEach(cb => cb.checked = checked);
|
||||
}
|
||||
|
||||
masterCheckbox.addEventListener('change', function () {
|
||||
updateDisplay(this.checked);
|
||||
});
|
||||
|
||||
// Initial state on load
|
||||
masterCheckbox.addEventListener('change', () => updateDisplay(masterCheckbox.checked));
|
||||
updateDisplay(masterCheckbox.checked);
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
"@
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user