dygraph-utils.js: isElementContainedBy -> isNodeContainedBy
[dygraphs.git] / dygraph-utils.js
index 8c6942b..0d3e66f 100644 (file)
@@ -79,7 +79,7 @@ Dygraph.log = function(severity, message) {
     // In older versions of Firefox, only console.log is defined.
     var console = window.console;
     var log = function(console, method, msg) {
-      if (method) {
+      if (method && typeof(method) == 'function') {
         method.call(console, msg);
       } else {
         console.log(msg);
@@ -301,6 +301,7 @@ Dygraph.findPosX = function(obj) {
   if(obj.offsetParent) {
     var copyObj = obj;
     while(1) {
+      // NOTE: the if statement here is for IE8.
       var borderLeft = "0";
       if (window.getComputedStyle) {
         borderLeft = window.getComputedStyle(copyObj, null).borderLeft || "0";
@@ -337,6 +338,7 @@ Dygraph.findPosY = function(obj) {
   if(obj.offsetParent) {
     var copyObj = obj;
     while(1) {
+      // NOTE: the if statement here is for IE8.
       var borderTop = "0";
       if (window.getComputedStyle) {
         borderTop = window.getComputedStyle(copyObj, null).borderTop || "0";
@@ -1234,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;
   }