X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Fchart-labels.js;h=34775fced4451dd2c1b90e16a0a405df4a0e7bb8;hb=bc3e2c5dd0baa4fae1624da1cb4ea39496a20319;hp=af12bcb11ec6db32dacd7d4c31da07137619df4a;hpb=98eb4713efecf58b904def42d9030e61bcbb4181;p=dygraphs.git diff --git a/plugins/chart-labels.js b/plugins/chart-labels.js index af12bcb..34775fc 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,14 +102,14 @@ 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; inner_div.appendChild(class_div); div.appendChild(inner_div); return div; -} +}; chart_labels.prototype.layout = function(e) { this.detachLabels_(); @@ -189,7 +191,7 @@ chart_labels.prototype.clearChart = function() { }; chart_labels.prototype.destroy = function() { - detachLabels(); + this.detachLabels_(); };