* on the event. The function takes one parameter: the event object.
* @private
*/
-Dygraph.prototype.addEvent = function addEvent(elem, type, fn) {
+Dygraph.prototype.addEvent = function(elem, type, fn) {
Dygraph.addEvent(elem, type, fn);
this.registeredEvents_.push({ elem : elem, type : type, fn : fn });
};
* on the event. The function takes one parameter: the event object.
* @private
*/
-Dygraph.removeEvent = function addEvent(elem, type, fn) {
+Dygraph.removeEvent = function(elem, type, fn) {
if (elem.removeEventListener) {
elem.removeEventListener(type, fn, false);
} else {
if(obj.offsetParent) {
var copyObj = obj;
while(1) {
+ var borderLeft = getComputedStyle(copyObj).borderLeft || "0";
+ curleft += parseInt(borderLeft, 10) ;
curleft += copyObj.offsetLeft;
if(!copyObj.offsetParent) {
break;
if(obj.offsetParent) {
var copyObj = obj;
while(1) {
+ var borderTop = getComputedStyle(copyObj).borderTop || "0";
+ curtop += parseInt(borderTop, 10) ;
curtop += copyObj.offsetTop;
if(!copyObj.offsetParent) {
break;
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();
delta = delta || Math.PI * 2 / sides;
ctx.beginPath();
- var first = true;
var initialAngle = rotationRadians;
var angle = initialAngle;
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);
+};