From 9e485963502a7a380497debe132e6555393d8c54 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 3 Sep 2014 13:28:45 -0700 Subject: [PATCH] Changed .class properties to ['class'] to prevent IE8 JS errors, IE8 treats class as an identifier instead of a property --- c3.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/c3.js b/c3.js index b794aaf..d885da5 100644 --- a/c3.js +++ b/c3.js @@ -3173,7 +3173,7 @@ .data(config.grid_x_lines); // enter xgridLine = $$.xgridLines.enter().append('g') - .attr("class", function (d) { return CLASS.xgridLine + (d.class ? ' ' + d.class : ''); }); + .attr("class", function (d) { return CLASS.xgridLine + (d["class"] ? ' ' + d["class"] : ''); }); xgridLine.append('line') .style("opacity", 0); xgridLine.append('text') @@ -3198,7 +3198,7 @@ .data(config.grid_y_lines); // enter ygridLine = $$.ygridLines.enter().append('g') - .attr("class", function (d) { return CLASS.ygridLine + (d.class ? ' ' + d.class : ''); }); + .attr("class", function (d) { return CLASS.ygridLine + (d["class"] ? ' ' + d["class"] : ''); }); ygridLine.append('line') .style("opacity", 0); ygridLine.append('text') @@ -3291,7 +3291,7 @@ return params ? function (line) { var found = false; [].concat(params).forEach(function (param) { - if ((('value' in param && line.value === params.value) || ('class' in param && line.class === params.class))) { + if ((('value' in param && line.value === params.value) || ('class' in param && line["class"]=== params["class"]))) { found = true; } }); @@ -5176,7 +5176,7 @@ return this.classShapes(d) + this.generateClass(CLASS.areas, d.id); }; c3_chart_internal_fn.classRegion = function (d, i) { - return this.generateClass(CLASS.region, i) + ' ' + ('class' in d ? d.class : ''); + return this.generateClass(CLASS.region, i) + ' ' + ('class' in d ? d["class"] : ''); }; c3_chart_internal_fn.classEvent = function (d) { return this.generateClass(CLASS.eventRect, d.index); @@ -5833,10 +5833,10 @@ config.regions = config.regions.filter(function (region) { var found = false; - if (!region.class) { + if (!region["class"]) { return true; } - region.class.split(' ').forEach(function (c) { + region["class"].split(' ').forEach(function (c) { if (classes.indexOf(c) >= 0) { found = true; } }); return !found; @@ -6224,4 +6224,4 @@ window.c3 = c3; } -})(window); +})(window); \ No newline at end of file