From 3aa0702ff88114f0cc34cb263323ffd1703ce2da Mon Sep 17 00:00:00 2001 From: Joe Cheng Date: Wed, 27 Jun 2012 11:10:22 -0700 Subject: [PATCH] Plots can now use --- examples/03_distributions/www/index.html | 2 +- www/shared/shiny.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/examples/03_distributions/www/index.html b/examples/03_distributions/www/index.html index d14be5ab3..d5cbeabb8 100644 --- a/examples/03_distributions/www/index.html +++ b/examples/03_distributions/www/index.html @@ -22,7 +22,7 @@

-
+
diff --git a/www/shared/shiny.js b/www/shared/shiny.js index f16ef3aa8..75ad58a85 100644 --- a/www/shared/shiny.js +++ b/www/shared/shiny.js @@ -103,12 +103,17 @@ }; (function() { this.onValueChange = function(data) { - $(this.el).empty(); - if (!data) - return; - var img = document.createElement('img'); - img.src = data; - this.el.appendChild(img); + if (this.el.tagName == 'IMG') { + this.el.src = data ? data : ''; + } + else { + $(this.el).empty(); + if (!data) + return; + var img = document.createElement('img'); + img.src = data; + this.el.appendChild(img); + } }; }).call(LivePlotBinding.prototype);