From 263aca4a4586dd1d9b99f72090ef29d54fc9b124 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sun, 23 Nov 2014 02:03:19 -0500 Subject: [PATCH] Fix for IE8 --- dygraph-utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dygraph-utils.js b/dygraph-utils.js index 4f90c65..bf93665 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -1148,7 +1148,13 @@ Dygraph.toRGB_ = function(colorStr) { div.style.backgroundColor = colorStr; div.style.visibility = 'hidden'; document.body.appendChild(div); - var rgbStr = window.getComputedStyle(div, null).backgroundColor; + var rgbStr; + if (window.getComputedStyle) { + rgbStr = window.getComputedStyle(div, null).backgroundColor; + } else { + // IE8 + rgbStr = div.currentStyle.backgroundColor; + } document.body.removeChild(div); var bits = /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(rgbStr); return { -- 2.7.4