Skip to content

Commit 7069064

Browse files
authored
Add non-minified selectize.js source; and respect shiny.minified option (#3918)
1 parent a0a83d5 commit 7069064

File tree

3 files changed

+3504
-8
lines changed

3 files changed

+3504
-8
lines changed

R/input-select.R

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,8 @@ selectizeDependencyFunc <- function(theme) {
253253
# name, the JS/CSS would be loaded/included twice, which leads to
254254
# strange issues, especially since we now include a 3rd party
255255
# accessibility plugin https://github.com/rstudio/shiny/pull/3153
256-
script <- file.path(
257-
selectizeDir, c("js/selectize.min.js", "accessibility/js/selectize-plugin-a11y.min.js")
258-
)
256+
script <- file.path(selectizeDir, selectizeScripts())
257+
259258
bslib::bs_dependency(
260259
input = sass::sass_file(stylesheet),
261260
theme = theme,
@@ -273,10 +272,18 @@ selectizeStaticDependency <- function(version) {
273272
src = "www/shared/selectize",
274273
package = "shiny",
275274
stylesheet = "css/selectize.bootstrap3.css",
276-
script = c(
277-
"js/selectize.min.js",
278-
"accessibility/js/selectize-plugin-a11y.min.js"
279-
)
275+
script = selectizeScripts()
276+
)
277+
}
278+
279+
selectizeScripts <- function() {
280+
isMinified <- isTRUE(get_devmode_option("shiny.minified", TRUE))
281+
paste0(
282+
c(
283+
"js/selectize",
284+
"accessibility/js/selectize-plugin-a11y"
285+
),
286+
if (isMinified) ".min.js" else ".js"
280287
)
281288
}
282289

0 commit comments

Comments
 (0)