Fix bug 428, add test which catches exception. What an annoying little bug.
[dygraphs.git] / experimental / palette / palette.js
index 8948333..514463f 100644 (file)
@@ -115,9 +115,7 @@ Palette.prototype.create = function(parentElement) {
 
       row.mouseover(function(source, title, type, body) {
           return function() {
-            // source[0] is un-jquerying.
-            // TODO(konigsberg): when tooltip is jquery, dump this.
-            palette.tooltip.show(source[0], title, type, body);
+            palette.tooltip.show(source, title, type, body);
           };
         } (row, opt, type, Dygraph.OPTIONS_REFERENCE[opt].description))
         .mouseout(function() { palette.tooltip.hide(); })
@@ -217,6 +215,9 @@ Palette.prototype.read = function() {
  * Write to input elements.
  */
 Palette.prototype.write = function(hash) {
+  if (!hash) {
+    return;
+  }
   var results = {};
   for (var opt in this.model) {
     if (this.model.hasOwnProperty(opt)) {