From: Lucas Bergman Date: Wed, 6 Mar 2013 21:02:33 +0000 (-0600) Subject: dygraph-utils.js: isElementContainedBy -> isNodeContainedBy X-Git-Tag: v1.0.0~40^2~4 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=bcb545f434f8284b56a4e5a201b6d8c1f60af702;p=dygraphs.git dygraph-utils.js: isElementContainedBy -> isNodeContainedBy This fixes a type nit when using the Closure Compiler, since walking parentNode can give an Element or Document node, not just an Element. --- diff --git a/dygraph-utils.js b/dygraph-utils.js index 035aba6..0d3e66f 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -1236,13 +1236,13 @@ Dygraph.detectLineDelimiter = function(data) { }; /** - * Is one element contained by another? - * @param {Element} containee The contained element. - * @param {Element} container The container element. + * Is one node contained by another? + * @param {Node} containee The contained node. + * @param {Node} container The container node. * @return {boolean} Whether containee is inside (or equal to) container. * @private */ -Dygraph.isElementContainedBy = function(containee, container) { +Dygraph.isNodeContainedBy = function(containee, container) { if (container === null || containee === null) { return false; } diff --git a/dygraph.js b/dygraph.js index 4316ac3..cec3071 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1019,8 +1019,8 @@ Dygraph.prototype.createInterface_ = function() { // 2. e.relatedTarget is outside the chart var target = e.target || e.fromElement; var relatedTarget = e.relatedTarget || e.toElement; - if (Dygraph.isElementContainedBy(target, dygraph.graphDiv) && - !Dygraph.isElementContainedBy(relatedTarget, dygraph.graphDiv)) { + if (Dygraph.isNodeContainedBy(target, dygraph.graphDiv) && + !Dygraph.isNodeContainedBy(relatedTarget, dygraph.graphDiv)) { dygraph.mouseOut_(e); } };