X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-utils.js;h=d2051bf51fcd3338135b4c5250efa3a193deff75;hb=b5481aea020c5fa66baef26508671591527bd3df;hp=6ca025fe0a83c0aaa91dc5a38ca5bbbd1f3879bc;hpb=7249a5aa13b2861eb6e79ca39059233fc6ed701d;p=dygraphs.git diff --git a/dygraph-utils.js b/dygraph-utils.js index 6ca025f..d2051bf 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -873,7 +873,7 @@ Dygraph.repeatAndCleanup = function(repeatFn, maxFrames, framePeriodInMillis, repeatFn(maxFrameArg); // Ensure final call with maxFrameArg. cleanupFn(); } else { - if (frameDelta != 0) { // Don't call repeatFn with duplicate frames. + if (frameDelta !== 0) { // Don't call repeatFn with duplicate frames. repeatFn(frameNumber); } loop(); @@ -1029,7 +1029,6 @@ Dygraph.regularShape_ = function( delta = delta || Math.PI * 2 / sides; ctx.beginPath(); - var first = true; var initialAngle = rotationRadians; var angle = initialAngle; @@ -1213,3 +1212,20 @@ Dygraph.detectLineDelimiter = function(data) { return null; }; + +/** + * Is one element contained by another? + * @param {Element} containee The contained element. + * @param {Element} container The container element. + * @return {boolean} Whether containee is inside (or equal to) container. + * @private + */ +Dygraph.isElementContainedBy = function(containee, container) { + if (container === null || containee === null) { + return false; + } + while (containee && containee !== container) { + containee = containee.parentNode; + } + return (containee === container); +};