fix the build-checkboxes function
This commit is contained in:
@@ -544,19 +544,16 @@ function Build-Checkboxes {
|
||||
Where-Object Column -EQ $Column |
|
||||
ForEach-Object {
|
||||
$taskId = $_.Id
|
||||
|
||||
# if the task has a Tooltip property, build a title attribute
|
||||
$titleAttr = if ($_.PSObject.Properties.Name -contains 'Tooltip' -and $_.Tooltip) {
|
||||
$tooltip = if ($_.PSObject.Properties.Name -contains 'Tooltip' -and $_.Tooltip) {
|
||||
" title='$($_.Tooltip)'"
|
||||
} else {
|
||||
''
|
||||
}
|
||||
} else { '' }
|
||||
|
||||
# inject the title attribute into the <label>
|
||||
$html = "<label$titleAttr><input type='checkbox' id='$taskId' name='$($_.Name)' data-column='$Column'> $($_.Label)</label>"
|
||||
$html = "<label$tooltip><input type='checkbox' id='$taskId' name='$($_.Name)' data-column='$Column'> $($_.Label)</label>"
|
||||
|
||||
if ($_.SubOptions) {
|
||||
$subHtml = $_.SubOptions | ForEach-Object {
|
||||
# join inside the code‐block is fine
|
||||
$subHtml = $_.SubOptions |
|
||||
ForEach-Object {
|
||||
"<label style='margin-left:20px; display:block;'>
|
||||
<input type='checkbox' class='sub-option-$taskId' name='$($_.Value)' value='$($_.Value)'> $($_.Label)
|
||||
</label>"
|
||||
@@ -566,7 +563,6 @@ function Build-Checkboxes {
|
||||
<div id='${taskId}OptionsContainer' style='display:none; margin-top:4px;'>
|
||||
$subHtml
|
||||
</div>
|
||||
|
||||
"@
|
||||
}
|
||||
|
||||
@@ -576,6 +572,7 @@ $subHtml
|
||||
}
|
||||
|
||||
|
||||
|
||||
### Get SVSMSP module version to display in the UI
|
||||
function Get-ModuleVersionHtml {
|
||||
$mod = Get-Module -ListAvailable -Name SVSMSP | Sort-Object Version -Descending | Select-Object -First 1
|
||||
|
||||
Reference in New Issue
Block a user