diff --git a/R/verbatim_popup.R b/R/verbatim_popup.R index 75959057..00b8c4e1 100644 --- a/R/verbatim_popup.R +++ b/R/verbatim_popup.R @@ -46,19 +46,16 @@ verbatim_popup_ui <- function(id, button_label, ...) { #' @param disabled (`reactive(1)`) the `shiny` reactive value holding a `logical`. The popup button is disabled #' when the flag is `TRUE` and enabled otherwise. #' In order for this to be used you need to have `shinyjs::useShinyjs()` in the `UI` of your application. -#' @param ignoreInit (`logical(1)`) should the observer be ignored on initialization -verbatim_popup_srv <- function(id, verbatim_content, title, style = FALSE, - disabled = shiny::reactiveVal(FALSE), ignoreInit = TRUE) { # nolint +verbatim_popup_srv <- function(id, verbatim_content, title, style = FALSE, disabled = shiny::reactiveVal(FALSE)) { checkmate::assert_string(id) checkmate::assert_string(title) checkmate::assert_flag(style) checkmate::assert_class(disabled, classes = "reactive") - checkmate::assert_flag(ignoreInit) moduleServer(id, function(input, output, session) { ns <- session$ns output$container <- renderUI({ - disabled_flag_observer(disabled, "button", ignoreInit) + disabled_flag_observer(disabled, "button") shiny::actionButton(session$ns("button"), label = "my label") }) @@ -81,8 +78,7 @@ verbatim_popup_srv <- function(id, verbatim_content, title, style = FALSE, #' @keywords internal #' @param disabled_flag (`reactive`) containing the flag #' @param button_id (`character(1)`) the id of the controlled button -#' @param ignoreInit (`logical(1)`) should the observer be ignored on initialization -disabled_flag_observer <- function(disabled_flag, button_id, ignoreInit = TRUE) { # nolint +disabled_flag_observer <- function(disabled_flag, button_id) { shiny::observeEvent( disabled_flag(), handlerExpr = { diff --git a/man/disabled_flag_observer.Rd b/man/disabled_flag_observer.Rd index fd10b2ac..4eab7d7a 100644 --- a/man/disabled_flag_observer.Rd +++ b/man/disabled_flag_observer.Rd @@ -4,14 +4,12 @@ \alias{disabled_flag_observer} \title{Creates a \code{shiny} observer handling the disabled flag.} \usage{ -disabled_flag_observer(disabled_flag, button_id, ignoreInit = TRUE) +disabled_flag_observer(disabled_flag, button_id) } \arguments{ \item{disabled_flag}{(\code{reactive}) containing the flag} \item{button_id}{(\code{character(1)}) the id of the controlled button} - -\item{ignoreInit}{(\code{logical(1)}) should the observer be ignored on initialization} } \description{ Creates a \code{shiny} observer handling the disabled flag. diff --git a/man/verbatim_popup.Rd b/man/verbatim_popup.Rd index d54c2cf3..b92fd2c0 100644 --- a/man/verbatim_popup.Rd +++ b/man/verbatim_popup.Rd @@ -13,8 +13,7 @@ verbatim_popup_srv( verbatim_content, title, style = FALSE, - disabled = shiny::reactiveVal(FALSE), - ignoreInit = TRUE + disabled = shiny::reactiveVal(FALSE) ) } \arguments{ @@ -35,8 +34,6 @@ If \code{verbatim_content} is a \code{condition} or \code{reactive} holding \cod \item{disabled}{(\code{reactive(1)}) the \code{shiny} reactive value holding a \code{logical}. The popup button is disabled when the flag is \code{TRUE} and enabled otherwise. In order for this to be used you need to have \code{shinyjs::useShinyjs()} in the \code{UI} of your application.} - -\item{ignoreInit}{(\code{logical(1)}) should the observer be ignored on initialization} } \value{ the UI function returns a \code{shiny.tag.list} object