Fixed lintr & complexity issues

This commit is contained in:
2026-02-03 15:06:31 +00:00
parent 27bccf2b84
commit 066455efa0
9 changed files with 60 additions and 90 deletions

View File

@@ -13,23 +13,15 @@ htmlMarkOptional <- function(input, optClass = "text-muted font-italic") {
opt_span <- htmltools::tags$span(class = optClass, " (optional)")
tq <- htmltools::tagQuery(input)
if (tq$hasClass("shiny-input-checkboxgroup")) {
tq <- tq$
children("label")$append(opt_span)$
reset()
tq <- tq$children("label")$append(opt_span)$reset()
} else if (tq$find(".shiny-options-group")$length() > 0) {
tq <- tq$
children("label")$append(opt_span)$
reset()
tq <- tq$children("label")$append(opt_span)$reset()
} else if (tq$find(".btn-file")$length() > 0) {
tq <- tq$
children("label")$append(opt_span)$
reset()
tq <- tq$children("label")$append(opt_span)$reset()
} else {
tq <- tq$
children(".checkbox")$find("label span")$append(opt_span)$
reset()$
find("label.control-label")$append(opt_span)$
reset()
children(".checkbox")$find("label span")$append(opt_span)$reset()$
find("label.control-label")$append(opt_span)$reset()
}
tq$allTags()
}