From 7b00bef2c3227d928b590ba9e17610adf1c8957e Mon Sep 17 00:00:00 2001 From: shark Date: Tue, 20 Dec 2016 21:53:54 +0100 Subject: [PATCH 1/4] adding the ID tag to the outmost div object in box() for a better control in the .css file --- R/boxes.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/boxes.R b/R/boxes.R index 4f287ec9..3f9541a8 100644 --- a/R/boxes.R +++ b/R/boxes.R @@ -119,6 +119,7 @@ infoBox <- function(title, value = NULL, subtitle = NULL, #' the user to collapse the box. #' @param collapsed If TRUE, start collapsed. This must be used with #' \code{collapsible=TRUE}. +#' @param id ID of the outmost div object for a better handling in the CSS file. #' @param ... Contents of the box. #' #' @family boxes @@ -250,7 +251,8 @@ 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) { + height = NULL, collapsible = FALSE, collapsed = FALSE, + id = NULL) { boxClass <- "box" if (solidHeader || !is.null(background)) { @@ -301,6 +303,7 @@ box <- function(..., title = NULL, footer = NULL, status = NULL, } div(class = if (!is.null(width)) paste0("col-sm-", width), + id = ifelse( !is.null(id), id, paste0("col-sm-", width)), div(class = boxClass, style = if (!is.null(style)) style, headerTag, From 22474fbfb94e8e0db859a9cc1b8ed5b3f06c7218 Mon Sep 17 00:00:00 2001 From: shark Date: Wed, 21 Dec 2016 17:58:03 +0100 Subject: [PATCH 2/4] adding the description of the ID argument --- man/box.Rd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/box.Rd b/man/box.Rd index 9626aaf0..364fae5e 100644 --- a/man/box.Rd +++ b/man/box.Rd @@ -6,7 +6,7 @@ \usage{ box(..., title = NULL, footer = NULL, status = NULL, solidHeader = FALSE, background = NULL, width = 6, height = NULL, - collapsible = FALSE, collapsed = FALSE) + collapsible = FALSE, collapsed = FALSE, id = NULL) } \arguments{ \item{...}{Contents of the box.} @@ -38,6 +38,8 @@ the user to collapse the box.} \item{collapsed}{If TRUE, start collapsed. This must be used with \code{collapsible=TRUE}.} + +\item{id}{ID of the outmost div object for a better handling in the CSS file.} } \description{ Boxes can be used to hold content in the main body of a dashboard. From 820baac0715eb9f57e9565270a1eb69ff4e2dfba Mon Sep 17 00:00:00 2001 From: shark Date: Wed, 21 Dec 2016 18:57:53 +0100 Subject: [PATCH 3/4] adding the id tag of the tab-box to the outmost div as well --- R/boxes.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/boxes.R b/R/boxes.R index 3f9541a8..0e78a22e 100644 --- a/R/boxes.R +++ b/R/boxes.R @@ -404,6 +404,7 @@ tabBox <- function(..., id = NULL, selected = NULL, title = NULL, tags$li(class = paste("header", titleClass), title) ) } - - div(class = paste0("col-sm-", width), content) + if ( is.null( id ) ) + id <- "" + div(class = paste0("col-sm-", width), content, id = id) } From 24d680c69a5ae126aee15278ab25347cf677e52b Mon Sep 17 00:00:00 2001 From: shark Date: Tue, 10 Jan 2017 21:00:02 +0100 Subject: [PATCH 4/4] adding README to explain motivation behind forking --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1ffcf59d..2be55759 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# Why I did this fork? + +Since I wanted the ID of a box to be set in the outmost div object and not somewhere in the third layer. Else I wouldn't be able to customize their behavior using CSS3. + Shiny Dashboard ===============