projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Closurize dygraph-options.js. Not done.
[dygraphs.git]
/
dygraph-utils.js
diff --git
a/dygraph-utils.js
b/dygraph-utils.js
index
67cf4f7
..
f53c81e
100644
(file)
--- a/
dygraph-utils.js
+++ b/
dygraph-utils.js
@@
-301,7
+301,11
@@
Dygraph.findPosX = function(obj) {
if(obj.offsetParent) {
var copyObj = obj;
while(1) {
if(obj.offsetParent) {
var copyObj = obj;
while(1) {
- var borderLeft = getComputedStyle(copyObj, null).borderLeft || "0";
+ // NOTE: the if statement here is for IE8.
+ var borderLeft = "0";
+ if (window.getComputedStyle) {
+ borderLeft = window.getComputedStyle(copyObj, null).borderLeft || "0";
+ }
curleft += parseInt(borderLeft, 10) ;
curleft += copyObj.offsetLeft;
if(!copyObj.offsetParent) {
curleft += parseInt(borderLeft, 10) ;
curleft += copyObj.offsetLeft;
if(!copyObj.offsetParent) {
@@
-334,7
+338,11
@@
Dygraph.findPosY = function(obj) {
if(obj.offsetParent) {
var copyObj = obj;
while(1) {
if(obj.offsetParent) {
var copyObj = obj;
while(1) {
- var borderTop = getComputedStyle(copyObj, null).borderTop || "0";
+ // NOTE: the if statement here is for IE8.
+ var borderTop = "0";
+ if (window.getComputedStyle) {
+ borderTop = window.getComputedStyle(copyObj, null).borderTop || "0";
+ }
curtop += parseInt(borderTop, 10) ;
curtop += copyObj.offsetTop;
if(!copyObj.offsetParent) {
curtop += parseInt(borderTop, 10) ;
curtop += copyObj.offsetTop;
if(!copyObj.offsetParent) {
@@
-1238,10
+1246,11
@@
Dygraph.isElementContainedBy = function(containee, container) {
if (container === null || containee === null) {
return false;
}
if (container === null || containee === null) {
return false;
}
- while (containee && containee !== container) {
- containee = containee.parentNode;
+ var containeeNode = /** @type {Node} */ (containee);
+ while (containeeNode && containeeNode !== container) {
+ containeeNode = containeeNode.parentNode;
}
}
- return (containee === container);
+ return (containee
Node
=== container);
};
};