add "use strict" to plugins -- was causing errors in dygraph-combined.js
[dygraphs.git] / plugins / annotations.js
index a3a13c3..796d6c3 100644 (file)
@@ -6,10 +6,19 @@
 
 Dygraph.Plugins.Annotations = (function() {
 
+"use strict";
+
 /**
 Current bits of jankiness:
 - Uses dygraph.layout_ to get the parsed annotations.
 - Uses dygraph.plotter_.area
+
+It would be nice if the plugin didn't require so much special support inside
+the core dygraphs classes, but annotations involve quite a bit of parsing and
+layout.
+
+TODO(danvk): cache DOM elements.
+
 */
 
 var annotations = function() {
@@ -23,7 +32,7 @@ annotations.prototype.toString = function() {
 annotations.prototype.activate = function(g) {
   return {
     clearChart: this.clearChart,
-    drawChart: this.drawChart
+    didDrawChart: this.didDrawChart
   };
 };
 
@@ -40,7 +49,7 @@ annotations.prototype.clearChart = function(e) {
   this.detachLabels();
 };
 
-annotations.prototype.drawChart = function(e) {
+annotations.prototype.didDrawChart = function(e) {
   var g = e.dygraph;
 
   // Early out in the (common) case of zero annotations.