Skip to content

Commit

Permalink
fixes timelyportfolio/parcoords#6: make sure data.evals is an array
Browse files Browse the repository at this point in the history
toJSON() in the current development version of shiny will unbox data.evals to a scalar, and we just make sure it is an array on the JavaScript side
  • Loading branch information
yihui committed Mar 16, 2015
1 parent dfac356 commit 9e8d792
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions inst/www/htmlwidgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
overrideMethod(shinyBinding, "renderValue", function(superfunc) {
return function(el, data) {
// Resolve strings marked as javascript literals to objects
if (!(data.evals instanceof Array)) data.evals = [data.evals];
for (var i = 0; data.evals && i < data.evals.length; i++) {
window.HTMLWidgets.evaluateStringMember(data.x, data.evals[i]);
}
Expand Down Expand Up @@ -469,6 +470,7 @@
if (scriptData) {
var data = JSON.parse(scriptData.textContent || scriptData.text);
// Resolve strings marked as javascript literals to objects
if (!(data.evals instanceof Array)) data.evals = [data.evals];
for (var k = 0; data.evals && k < data.evals.length; k++) {
window.HTMLWidgets.evaluateStringMember(data.x, data.evals[k]);
}
Expand Down

0 comments on commit 9e8d792

Please sign in to comment.