Compare commits
2 Commits
392c545b8d
...
09fba759b6
| Author | SHA1 | Date | |
|---|---|---|---|
| 09fba759b6 | |||
| c1c81c597e |
@@ -1,6 +1,6 @@
|
||||
Package: AVSDevR.HTMLUtils
|
||||
Title: Utility Functions For Modifying R HTML Elements
|
||||
Version: 0.0.2
|
||||
Version: 0.0.3
|
||||
Authors@R:
|
||||
person("Craig", "Williams", , "craig@avsdev.uk", role = c("aut", "cre"))
|
||||
Description: Collection of utility functions for modifying HTML markup of
|
||||
|
||||
@@ -8,6 +8,7 @@ export(htmlFixBoxCollapseButtonAria)
|
||||
export(htmlMarkOptional)
|
||||
export(htmlMarkRequired)
|
||||
export(htmlRemoveAttributes)
|
||||
export(htmlRemoveBoxTitle)
|
||||
export(htmlReplaceBoxTitleLevel)
|
||||
export(htmlSetMaxLength)
|
||||
export(htmlSetMinLength)
|
||||
|
||||
@@ -153,3 +153,22 @@ htmlAddBoxHelpLink <- function(box, href, title = NULL) {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
#' Removes title from box element (leaving an un-titled box with header if required)
|
||||
#'
|
||||
#' @param box The box to remove the title from
|
||||
#' @param removeHeader Remove the header as well
|
||||
#'
|
||||
#' @return The modified box
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' x <- shinydashboard::box(title = "TBR")
|
||||
#' htmlRemoveBoxTitle(x)
|
||||
htmlRemoveBoxTitle <- function(box, removeHeader = FALSE) {
|
||||
if (removeHeader) {
|
||||
htmltools::tagQuery(box)$find(".box-header")$remove()$allTags()
|
||||
} else {
|
||||
htmltools::tagQuery(box)$find(".box-title")$remove()$allTags()
|
||||
}
|
||||
}
|
||||
|
||||
23
man/htmlRemoveBoxTitle.Rd
Normal file
23
man/htmlRemoveBoxTitle.Rd
Normal file
@@ -0,0 +1,23 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/htmlBoxManipulation.R
|
||||
\name{htmlRemoveBoxTitle}
|
||||
\alias{htmlRemoveBoxTitle}
|
||||
\title{Removes title from box element (leaving an un-titled box with header if required)}
|
||||
\usage{
|
||||
htmlRemoveBoxTitle(box, removeHeader = FALSE)
|
||||
}
|
||||
\arguments{
|
||||
\item{box}{The box to remove the title from}
|
||||
|
||||
\item{removeHeader}{Remove the header as well}
|
||||
}
|
||||
\value{
|
||||
The modified box
|
||||
}
|
||||
\description{
|
||||
Removes title from box element (leaving an un-titled box with header if required)
|
||||
}
|
||||
\examples{
|
||||
x <- shinydashboard::box(title = "TBR")
|
||||
htmlRemoveBoxTitle(x)
|
||||
}
|
||||
Reference in New Issue
Block a user