From 13f8b0472ff8e7336bdf56f69ff838a1f3e76162 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 25 Jul 2012 13:53:03 -0400 Subject: [PATCH] add "use strict" to plugins -- was causing errors in dygraph-combined.js --- plugins/annotations.js | 2 ++ plugins/axes.js | 2 ++ plugins/chart-labels.js | 6 ++++-- plugins/legend.js | 1 - 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/annotations.js b/plugins/annotations.js index d47f8c7..796d6c3 100644 --- a/plugins/annotations.js +++ b/plugins/annotations.js @@ -6,6 +6,8 @@ Dygraph.Plugins.Annotations = (function() { +"use strict"; + /** Current bits of jankiness: - Uses dygraph.layout_ to get the parsed annotations. diff --git a/plugins/axes.js b/plugins/axes.js index 81068fe..88d2fc8 100644 --- a/plugins/axes.js +++ b/plugins/axes.js @@ -6,6 +6,8 @@ Dygraph.Plugins.Axes = (function() { +"use strict"; + /* Bits of jankiness: diff --git a/plugins/chart-labels.js b/plugins/chart-labels.js index af12bcb..d6c1095 100644 --- a/plugins/chart-labels.js +++ b/plugins/chart-labels.js @@ -5,6 +5,8 @@ */ Dygraph.Plugins.ChartLabels = (function() { +"use strict"; + // TODO(danvk): move chart label options out of dygraphs and into the plugin. // TODO(danvk): only tear down & rebuild the DIVs when it's necessary. @@ -58,7 +60,7 @@ chart_labels.prototype.detachLabels_ = function() { var createRotatedDiv = function(g, box, axis, classes, html) { // TODO(danvk): is this outer div actually necessary? - div = document.createElement("div"); + var div = document.createElement("div"); div.style.position = 'absolute'; if (axis == 1) { // NOTE: this is cheating. Should be positioned relative to the box. @@ -100,7 +102,7 @@ var createRotatedDiv = function(g, box, axis, classes, html) { inner_div.style.top = '0px'; } - class_div = document.createElement("div"); + var class_div = document.createElement("div"); class_div.className = classes; class_div.innerHTML = html; diff --git a/plugins/legend.js b/plugins/legend.js index 85424c6..c124c38 100644 --- a/plugins/legend.js +++ b/plugins/legend.js @@ -5,7 +5,6 @@ */ Dygraph.Plugins.Legend = (function() { - /* Current bits of jankiness: -- 2.7.4