Skip to content

Commit

Permalink
Handle the non-bslib case; better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Jun 14, 2021
1 parent fa95894 commit 3bb56d5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions R/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3bb56d5

Please sign in to comment.