Skip to content

Commit

Permalink
T -> TRUE && if boxTools are not null, create a div for them
Browse files Browse the repository at this point in the history
delete spaces, hopefully
  • Loading branch information
dmpe committed Mar 28, 2016
1 parent c7d864b commit a8d71cc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
6 changes: 4 additions & 2 deletions R/boxes.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ infoBox <- function(title, value = NULL, subtitle = NULL,
#' @param collapsed If TRUE, start collapsed. This must be used with
#' \code{collapsible=TRUE}.
#' @param ... Contents of the box/boxItem.
#' @param boxMenu Adds a box menu.
#' @param boxMenu Adds a box menu consisting of \link{boxItem}.
#'
#' @family boxes
#'
Expand Down Expand Up @@ -291,7 +291,9 @@ box <- function(..., title = NULL, footer = NULL, status = NULL,
shiny::icon(collapseIcon))
}

boxTools <- div(class = "box-tools pull-right", collapseTag, boxMenu)
if (!is.null(boxMenu)) {
boxTools <- div(class = "box-tools pull-right", collapseTag, boxMenu)
}

headerTag <- NULL
if (!is.null(titleTag) || !is.null(boxTools)) {
Expand Down
4 changes: 2 additions & 2 deletions R/dashboardHeader.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ dropdownMenu <- function(...,
)
# TODO: This would need to be added to the outer ul
# tags$li(class = "footer", a(href="#", "View all"))
)
)
)
)

}

Expand Down
2 changes: 1 addition & 1 deletion man/box.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions tests-manual/box.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ body <- dashboardBody(
choices = c("0%" = 0, "20%" = 20, "40%" = 40, "60%" = 60, "80%" = 80,
"100%" = 100)
),
boxMenu = boxItem(a(href="https://www.bing.com", "bing it!",
style = "color: yellow", target = "_blank"),
downloadButton("svgdown", "download svg")),
collapsible = T, collapsed = T
#boxMenu = boxItem(a(href="https://www.bing.com", "bing it!",
# style = "color: yellow", target = "_blank"),
# downloadButton("svgdown", "download svg")),
collapsible = FALSE, collapsed = FALSE
),
box(title = "Histogram box title",
status = "info", solidHeader = TRUE, collapsible = T,
status = "info", solidHeader = TRUE, collapsible = FALSE,
boxMenu = boxMenuOutput("menuWrench"),
plotOutput("plot", height = 250)
)
Expand Down

0 comments on commit a8d71cc

Please sign in to comment.