R/handlers.R

Defines functions closePanel openPanel handlersObject

Documented in closePanel openPanel

handlersObject <- function(ns) {
  paste0("window.jsmodule['@/shiny.blueprint'].panelStackHandlers['", ns, "']")
}

#' @rdname PanelStack
#' @param panelId Id of the panel to be closed
#' @export
openPanel <- function(panelId, ns = "ps") {
  JS(paste0(
    "() => ", handlersObject(ns), ".openPanel('", panelId, "')"
  ))
}

#' @rdname PanelStack
#' @export
closePanel <- function(ns = "ps") {
  JS("() => ", handlersObject(ns), ".closePanel()")
}

Try the shiny.blueprint package in your browser

Any scripts or data that you put into this service are public.

shiny.blueprint documentation built on May 29, 2024, 11:29 a.m.