mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-29 03:00:45 -04:00
allow pullLeft/Right functions to take tags or lists of tags; validate that all inputs are tags
This commit is contained in:
@@ -299,7 +299,9 @@ horizontalLayout <- function(...) {
|
||||
#' @rdname horizontalLayout
|
||||
#' @export
|
||||
pullLeft <- function(...) {
|
||||
lapply(list(...), function(element) {
|
||||
lapply(flattenTags(list(...)), function(element) {
|
||||
if (!isTag(element))
|
||||
stop("pullLeft - passed argument not a shiny UI element", call. = FALSE)
|
||||
element$attribs$class <- paste(element$attribs$class, "pull-left")
|
||||
element
|
||||
})
|
||||
@@ -308,13 +310,14 @@ pullLeft <- function(...) {
|
||||
#' @rdname horizontalLayout
|
||||
#' @export
|
||||
pullRight <- function(...) {
|
||||
lapply(list(...), function(element) {
|
||||
lapply(flattenTags(list(...)), function(element) {
|
||||
if (!isTag(element))
|
||||
stop("pullRight - passed argument not a shiny UI element", call. = FALSE)
|
||||
element$attribs$class <- paste(element$attribs$class, "pull-right")
|
||||
element
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
# Helper function to test whether an element has a span class
|
||||
validateSpan <- function(element, name, width = NA) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user