From 3bb56d56c413cf5957ed6a7ffc46312b4e1061ac Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 27 May 2021 10:12:57 -0500 Subject: [PATCH] Handle the non-bslib case; better comments --- R/bootstrap.R | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/R/bootstrap.R b/R/bootstrap.R index cda0dd596e..9912ba86bd 100644 --- a/R/bootstrap.R +++ b/R/bootstrap.R @@ -82,10 +82,15 @@ getLang <- function(ui) { #' @inheritParams bootstrapPage #' @export bootstrapLib <- function(theme = NULL) { - # To support static rendering of version dependent markup (e.g., - # tabsetPanel()), we setCurrentTheme() at the start of the render (since - # bootstrapLib() comes first in bootstrapPage()), and cleanup afterwards if - # shiny isn't running (in that case, since setCurrentTheme() uses + # In the non-bslib case, return static HTML dependencies + if (!is_bs_theme(theme)) { + return(bootstrapDependency(theme)) + } + # To support static rendering of Bootstrap version dependent markup (e.g., + # tabsetPanel()), setCurrentTheme() at the start of the render (since + # bootstrapLib() comes first in bootstrapPage(), all other UI should then know + # what version of Bootstrap is being used). Then restore state after render as + # long as shiny isn't running (in that case, since setCurrentTheme() uses # shinyOptions(), state will be automatically be restored when the app exits) oldTheme <- NULL tagList(