From: steve Date: Tue, 7 Sep 2010 15:50:13 +0000 (-0600) Subject: Added ability to treat the labelsDiv as a ID as well as an Element. This allows... X-Git-Tag: v1.0.0~664^2~4 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=fedbd79791fa8b1661162e360b280cd4a8bfc839;p=dygraphs.git Added ability to treat the labelsDiv as a ID as well as an Element. This allows the user to set the id of the labels div prior to it being rendered in the DOM. Helpful for GWT wrapper implementation. --- diff --git a/dygraph.js b/dygraph.js index f5e7d38..5e04d1d 100644 --- a/dygraph.js +++ b/dygraph.js @@ -612,7 +612,12 @@ Dygraph.findPosY = function(obj) { * been specified. * @private */ -Dygraph.prototype.createStatusMessage_ = function(){ +Dygraph.prototype.createStatusMessage_ = function() { + var userLabelsDiv = this.user_attrs_["labelsDiv"]; + if (userLabelsDiv && null != userLabelsDiv + && (typeof(userLabelsDiv) == "string" || userLabelsDiv instanceof String)) { + this.user_attrs_["labelsDiv"] = document.getElementById(userLabelsDiv); + } if (!this.attr_("labelsDiv")) { var divWidth = this.attr_('labelsDivWidth'); var messagestyle = {