Skip to content

Commit

Permalink
squash several last commits into one - second one
Browse files Browse the repository at this point in the history
  • Loading branch information
dmpe committed Mar 3, 2016
1 parent 7eb95e4 commit bc73dc9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ shinydashboard 0.5.1.9000
--------------------------------------------------------------------------------
* Updated to AdminLTE 2.3.2 (1ee281b).

* Add wrench icon to the box-header (now can use dropdown menu)

shinydashboard 0.5.1
--------------------------------------------------------------------------------

Expand Down
13 changes: 7 additions & 6 deletions R/boxes.R
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ infoBox <- function(title, value = NULL, subtitle = NULL,
#' @export
box <- function(..., title = NULL, footer = NULL, status = NULL,
solidHeader = FALSE, background = NULL, width = 6,
height = NULL, collapsible = FALSE, collapsed = FALSE, wrench = FALSE) {
height = NULL, collapsible = FALSE, collapsed = FALSE, wrench = FALSE, wrenchOptions = NULL) {

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

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

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

headerTag <- NULL
if (!is.null(titleTag) || !is.null(boxToolsTag) ) {
if (!is.null(titleTag) || !is.null(boxToolsTag)) {
headerTag <- div(class = "box-header",
titleTag,
boxToolsTag
Expand Down
2 changes: 1 addition & 1 deletion R/deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ addDeps <- function(x) {
}

dashboardDeps <- list(
htmlDependency("AdminLTE", "2.0.6",
htmlDependency("AdminLTE", "2.3.2",
c(file = system.file("AdminLTE", package = "shinydashboard")),
script = adminLTE_js,
stylesheet = adminLTE_css
Expand Down
3 changes: 2 additions & 1 deletion man/box.Rd

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

2 changes: 1 addition & 1 deletion tests-manual/box.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ body <- dashboardBody(
)
),
box(title = "Histogram box title",
status = "warning", solidHeader = TRUE, collapsible = F, wrench = T,
status = "warning", solidHeader = TRUE, collapsible = F, wrench = T, wrenchOptions = tags$li(a(href="https://google.cz", "Click here!")),
plotOutput("plot", height = 250)
)
),
Expand Down

0 comments on commit bc73dc9

Please sign in to comment.