From bcb545f434f8284b56a4e5a201b6d8c1f60af702 Mon Sep 17 00:00:00 2001 From: Lucas Bergman Date: Wed, 6 Mar 2013 15:02:33 -0600 Subject: [PATCH] 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. --- dygraph-utils.js | 8 ++++---- dygraph.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) 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); } }; -- 2.7.4