X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-utils.js;h=11a2fba2f76861806fde946af6be631083e9d8ca;hb=870190b5b5ad4e2ee930d14ac1c5d0e2be6f8fe0;hp=6aa7dfcafd9e8a28bcdd393def0bf7d5688778f2;hpb=5ad7495d3176ab8f7e79304be352ffe1e24bfb35;p=dygraphs.git diff --git a/dygraph-utils.js b/dygraph-utils.js index 6aa7dfc..11a2fba 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -301,7 +301,11 @@ Dygraph.findPosX = function(obj) { if(obj.offsetParent) { var copyObj = obj; while(1) { - var borderLeft = window.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) { @@ -334,7 +338,11 @@ Dygraph.findPosY = function(obj) { if(obj.offsetParent) { var copyObj = obj; while(1) { - var borderTop = window.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) {