Skip to content

Commit a8d71cc

Browse files
committed
T -> TRUE && if boxTools are not null, create a div for them
delete spaces, hopefully
1 parent c7d864b commit a8d71cc

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

R/boxes.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ infoBox <- function(title, value = NULL, subtitle = NULL,
120120
#' @param collapsed If TRUE, start collapsed. This must be used with
121121
#' \code{collapsible=TRUE}.
122122
#' @param ... Contents of the box/boxItem.
123-
#' @param boxMenu Adds a box menu.
123+
#' @param boxMenu Adds a box menu consisting of \link{boxItem}.
124124
#'
125125
#' @family boxes
126126
#'
@@ -291,7 +291,9 @@ box <- function(..., title = NULL, footer = NULL, status = NULL,
291291
shiny::icon(collapseIcon))
292292
}
293293

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

296298
headerTag <- NULL
297299
if (!is.null(titleTag) || !is.null(boxTools)) {

R/dashboardHeader.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ dropdownMenu <- function(...,
198198
)
199199
# TODO: This would need to be added to the outer ul
200200
# tags$li(class = "footer", a(href="#", "View all"))
201-
)
202-
)
201+
)
202+
)
203203

204204
}
205205

man/box.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests-manual/box.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ body <- dashboardBody(
4242
choices = c("0%" = 0, "20%" = 20, "40%" = 40, "60%" = 60, "80%" = 80,
4343
"100%" = 100)
4444
),
45-
boxMenu = boxItem(a(href="https://www.bing.com", "bing it!",
46-
style = "color: yellow", target = "_blank"),
47-
downloadButton("svgdown", "download svg")),
48-
collapsible = T, collapsed = T
45+
#boxMenu = boxItem(a(href="https://www.bing.com", "bing it!",
46+
# style = "color: yellow", target = "_blank"),
47+
# downloadButton("svgdown", "download svg")),
48+
collapsible = FALSE, collapsed = FALSE
4949
),
5050
box(title = "Histogram box title",
51-
status = "info", solidHeader = TRUE, collapsible = T,
51+
status = "info", solidHeader = TRUE, collapsible = FALSE,
5252
boxMenu = boxMenuOutput("menuWrench"),
5353
plotOutput("plot", height = 250)
5454
)

0 commit comments

Comments
 (0)