Browse Source

Changed .class properties to ['class'] to prevent IE8 JS errors, IE8 treats class as an identifier instead of a property

pull/537/head
Jeff 10 years ago
parent
commit
9e48596350
  1. 14
      c3.js

14
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);
Loading…
Cancel
Save