updated build-checkboxes to add tooltip
This commit is contained in:
@@ -544,17 +544,23 @@ function Build-Checkboxes {
|
|||||||
Where-Object Column -EQ $Column |
|
Where-Object Column -EQ $Column |
|
||||||
ForEach-Object {
|
ForEach-Object {
|
||||||
$taskId = $_.Id
|
$taskId = $_.Id
|
||||||
$html = "<label><input type='checkbox' id='$taskId' name='$($_.Name)' data-column='$Column'> $($_.Label)</label>"
|
|
||||||
|
# if the task has a Tooltip property, build a title attribute
|
||||||
|
$titleAttr = if ($_.PSObject.Properties.Name -contains 'Tooltip' -and $_.Tooltip) {
|
||||||
|
" title='$($_.Tooltip)'"
|
||||||
|
} else {
|
||||||
|
''
|
||||||
|
}
|
||||||
|
|
||||||
|
# inject the title attribute into the <label>
|
||||||
|
$html = "<label$titleAttr><input type='checkbox' id='$taskId' name='$($_.Name)' data-column='$Column'> $($_.Label)</label>"
|
||||||
|
|
||||||
if ($_.SubOptions) {
|
if ($_.SubOptions) {
|
||||||
|
$subHtml = $_.SubOptions | ForEach-Object {
|
||||||
$subHtml = (
|
|
||||||
$_.SubOptions | ForEach-Object {
|
|
||||||
"<label style='margin-left:20px; display:block;'>
|
"<label style='margin-left:20px; display:block;'>
|
||||||
<input type='checkbox' class='sub-option-$taskId' name='$($_.Value)' value='$($_.Value)'> $($_.Label)
|
<input type='checkbox' class='sub-option-$taskId' name='$($_.Value)' value='$($_.Value)'> $($_.Label)
|
||||||
</label>"
|
</label>"
|
||||||
}
|
} -join "`n"
|
||||||
) -join "`n"
|
|
||||||
|
|
||||||
$html += @"
|
$html += @"
|
||||||
<div id='${taskId}OptionsContainer' style='display:none; margin-top:4px;'>
|
<div id='${taskId}OptionsContainer' style='display:none; margin-top:4px;'>
|
||||||
|
|||||||
Reference in New Issue
Block a user