Skip to content

Commit

Permalink
add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Apr 19, 2023
1 parent a4e9378 commit 61099ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 5 additions & 3 deletions R/fullscreen_button.R
Expand Up @@ -6,6 +6,7 @@
#' @param type Type of the button ("info", "danger", etc.)
#' @param target Id of the element to put on fullscreen. If `NULL`, the whole
#' page is put on fullscreen.
#' @param icon Icon to add before the label on the button
#'
#' @return Put an element or the whole page on fullscreen
#' @export
Expand Down Expand Up @@ -34,7 +35,8 @@ fullscreen_button <- function(
label,
class = NULL,
type = "default",
target = NULL
target = NULL,
icon = NULL
){

target <- if (is.null(target)) "body" else paste0("#", target)
Expand All @@ -43,9 +45,9 @@ fullscreen_button <- function(
cl <- sprintf("btn btn-%s", type)
cl <- paste(cl, class)

args <- list(class = cl, label, id = id)
args <- list(class = cl, label = label, inputId = id, icon = icon)

ui_element <- do.call(shiny::a, args)
ui_element <- do.call(shiny::actionButton, args)

shiny::tagList(
shiny::singleton(
Expand Down
11 changes: 10 additions & 1 deletion man/fullscreen_button.Rd

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

0 comments on commit 61099ba

Please sign in to comment.