Skip to content

Commit 3bb56d5

Browse files
committed
Handle the non-bslib case; better comments
1 parent fa95894 commit 3bb56d5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

R/bootstrap.R

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,15 @@ getLang <- function(ui) {
8282
#' @inheritParams bootstrapPage
8383
#' @export
8484
bootstrapLib <- function(theme = NULL) {
85-
# To support static rendering of version dependent markup (e.g.,
86-
# tabsetPanel()), we setCurrentTheme() at the start of the render (since
87-
# bootstrapLib() comes first in bootstrapPage()), and cleanup afterwards if
88-
# shiny isn't running (in that case, since setCurrentTheme() uses
85+
# In the non-bslib case, return static HTML dependencies
86+
if (!is_bs_theme(theme)) {
87+
return(bootstrapDependency(theme))
88+
}
89+
# To support static rendering of Bootstrap version dependent markup (e.g.,
90+
# tabsetPanel()), setCurrentTheme() at the start of the render (since
91+
# bootstrapLib() comes first in bootstrapPage(), all other UI should then know
92+
# what version of Bootstrap is being used). Then restore state after render as
93+
# long as shiny isn't running (in that case, since setCurrentTheme() uses
8994
# shinyOptions(), state will be automatically be restored when the app exits)
9095
oldTheme <- NULL
9196
tagList(

0 commit comments

Comments
 (0)