Skip to content

Commit

Permalink
Add non-minified selectize.js source; and respect shiny.minified opti…
Browse files Browse the repository at this point in the history
…on (#3918)
  • Loading branch information
cpsievert authored Oct 19, 2023
1 parent a0a83d5 commit 7069064
Show file tree
Hide file tree
Showing 3 changed files with 3,504 additions and 8 deletions.
21 changes: 14 additions & 7 deletions R/input-select.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,8 @@ selectizeDependencyFunc <- function(theme) {
# name, the JS/CSS would be loaded/included twice, which leads to
# strange issues, especially since we now include a 3rd party
# accessibility plugin https://github.com/rstudio/shiny/pull/3153
script <- file.path(
selectizeDir, c("js/selectize.min.js", "accessibility/js/selectize-plugin-a11y.min.js")
)
script <- file.path(selectizeDir, selectizeScripts())

bslib::bs_dependency(
input = sass::sass_file(stylesheet),
theme = theme,
Expand All @@ -273,10 +272,18 @@ selectizeStaticDependency <- function(version) {
src = "www/shared/selectize",
package = "shiny",
stylesheet = "css/selectize.bootstrap3.css",
script = c(
"js/selectize.min.js",
"accessibility/js/selectize-plugin-a11y.min.js"
)
script = selectizeScripts()
)
}

selectizeScripts <- function() {
isMinified <- isTRUE(get_devmode_option("shiny.minified", TRUE))
paste0(
c(
"js/selectize",
"accessibility/js/selectize-plugin-a11y"
),
if (isMinified) ".min.js" else ".js"
)
}

Expand Down
Loading

0 comments on commit 7069064

Please sign in to comment.