Skip to content

Commit

Permalink
add offset arg to argonColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Jun 4, 2019
1 parent 2deec37 commit 7a110c0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# argonR 0.2.0.9000
- add offset arg to `argonColumn()`
- Add btn_text argument to `argonCard()`
- Fix #1: headroom.js and add the corresponding argument to `argonNavbar()`
- Fix #7 introduced with #4
Expand Down
9 changes: 5 additions & 4 deletions R/argonColumn.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' @param ... Any UI element.
#' @param width Optional. Column width between 1 and 12.
#' @param center Whether to center column elements or not. FALSE by default.
#' @param offset Column offset. NULL by default. Importantly, offset + width cannot exceed 12!
#'
#' @examples
#' if (interactive()) {
Expand All @@ -24,10 +25,10 @@
#' @author David Granjon, \email{dgranjon@@ymail.com}
#'
#' @export
argonColumn <- function(..., width = NULL, center = FALSE) {

colCl <- if(!is.null(width)) paste0("col-sm-", width) else "col-sm"
argonColumn <- function (..., width = NULL, center = FALSE, offset = NULL) {
colCl <- "col-sm"
if (!is.null(width)) colCl <- paste0(colCl, " col-sm-", width)
if (!is.null(offset)) colCl <- paste0(colCl, " offset-sm-", offset)
if (center) colCl <- paste0(colCl, " text-center")

htmltools::tags$div(class = colCl, ...)
}
2 changes: 1 addition & 1 deletion docs/articles/getting_started.html

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

2 changes: 2 additions & 0 deletions docs/news/index.html

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

6 changes: 5 additions & 1 deletion docs/reference/argonColumn.html

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

4 changes: 3 additions & 1 deletion man/argonColumn.Rd

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

0 comments on commit 7a110c0

Please sign in to comment.