Added method for removing the title from a shinydashboard::box
This commit is contained in:
@@ -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