Skip to content

Commit

Permalink
Fixed bug with extendShinyjs() where it didn't work when using a sc…
Browse files Browse the repository at this point in the history
…ript and didn't have `V8` installed; fixes #64
  • Loading branch information
daattali committed Apr 5, 2016
1 parent 8c31a2c commit fe0b638
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinyjs
Title: Perform Common JavaScript Operations in Shiny Apps using Plain R Code
Version: 0.5.2
Version: 0.5.3
Authors@R: person("Dean", "Attali", email = "[email protected]",
role = c("aut", "cre"))
Description: Perform common JavaScript operations in Shiny applications without
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# shinyjs 0.5.3

2016-04-05

- Fixed bug with `extendShinyjs()` where it didn't work when using a script and didn't have `V8` installed (#64)

# shinyjs 0.5.2

2016-03-25
Expand Down
8 changes: 6 additions & 2 deletions R/extendShinyjs.R
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,6 @@ extendShinyjs <- function(script, text, functions) {

tryCatch({
ct$source(script)
shiny::addResourcePath("shinyjs-extend", dirname(script))
script <- file.path("shinyjs-extend", basename(script))
}, error = function(err) {
errMsg(sprintf("Error parsing the JavaScript file: %s.", err$message))
})
Expand Down Expand Up @@ -311,6 +309,12 @@ extendShinyjs <- function(script, text, functions) {
assign(x, jsFunc, js)
})

# Add the script as a resource
if (!missing(script)) {
shiny::addResourcePath("shinyjs-extend", dirname(script))
script <- file.path("shinyjs-extend", basename(script))
}

# set up the message handlers for all functions
setupJS(jsFuncs, script, text)
}
Expand Down
2 changes: 1 addition & 1 deletion inst/srcjs/shinyjs-default-funcs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// shinyjs 0.5.2 by Dean Attali
// shinyjs 0.5.3 by Dean Attali
// Perform common JavaScript operations in Shiny apps using plain R code

shinyjs = function() {
Expand Down

0 comments on commit fe0b638

Please sign in to comment.