Skip to content

Commit d1f9293

Browse files
committed
squash several last commits into one - second one
1 parent 800542f commit d1f9293

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ shinydashboard 0.5.1.9000
22
--------------------------------------------------------------------------------
33
* Updated to AdminLTE 2.3.2 (1ee281b).
44

5+
* Add wrench icon to the box-header (now can use dropdown menu)
6+
57
shinydashboard 0.5.1
68
--------------------------------------------------------------------------------
79

R/boxes.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ infoBox <- function(title, value = NULL, subtitle = NULL,
251251
#' @export
252252
box <- function(..., title = NULL, footer = NULL, status = NULL,
253253
solidHeader = FALSE, background = NULL, width = 6,
254-
height = NULL, collapsible = FALSE, collapsed = FALSE, wrench = FALSE) {
254+
height = NULL, collapsible = FALSE, collapsed = FALSE, wrench = FALSE, wrenchOptions = NULL) {
255255

256256
boxClass <- "box"
257257
if (solidHeader || !is.null(background)) {
@@ -299,11 +299,12 @@ box <- function(..., title = NULL, footer = NULL, status = NULL,
299299
collapseTag <- tags$button(class = paste0("btn btn-box-tool"), `data-widget` = "collapse", shiny::icon(collapseIcon))
300300
}
301301

302-
if(wrench == TRUE) {
302+
if (wrench == TRUE) {
303303
wrenchTag <- div(class = paste0("btn-group"),
304-
tags$button(class = "btn btn-box-tool dropdown-toggle", `type` = "button", `data-toggle` = "dropdown", shiny::icon("wrench")),
305-
tags$ul(class = "dropdown-menu", `role` = "menu")
306-
## todo vymyslet jak zaridit abych to pouzivatelne z UI
304+
tags$button(class = "btn btn-box-tool dropdown-toggle", `type` = "button",
305+
`data-toggle` = "dropdown", shiny::icon("wrench")),
306+
tags$ul(class = "dropdown-menu", `role` = "menu", wrenchOptions)
307+
## TODO: how to display them ?
307308
)
308309
}
309310

@@ -314,7 +315,7 @@ box <- function(..., title = NULL, footer = NULL, status = NULL,
314315
}
315316

316317
headerTag <- NULL
317-
if (!is.null(titleTag) || !is.null(boxToolsTag) ) {
318+
if (!is.null(titleTag) || !is.null(boxToolsTag)) {
318319
headerTag <- div(class = "box-header",
319320
titleTag,
320321
boxToolsTag

R/deps.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ addDeps <- function(x) {
2020
}
2121

2222
dashboardDeps <- list(
23-
htmlDependency("AdminLTE", "2.0.6",
23+
htmlDependency("AdminLTE", "2.3.2",
2424
c(file = system.file("AdminLTE", package = "shinydashboard")),
2525
script = adminLTE_js,
2626
stylesheet = adminLTE_css

man/box.Rd

Lines changed: 2 additions & 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ body <- dashboardBody(
4242
)
4343
),
4444
box(title = "Histogram box title",
45-
status = "warning", solidHeader = TRUE, collapsible = F, wrench = T,
45+
status = "warning", solidHeader = TRUE, collapsible = F, wrench = T, wrenchOptions = tags$li(a(href="https://google.cz", "Click here!")),
4646
plotOutput("plot", height = 250)
4747
)
4848
),

0 commit comments

Comments
 (0)