Skip to content

Commit

Permalink
Merge pull request dc-js#489
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwoodhull committed Feb 4, 2014
2 parents a274020 + 4a01baf commit 191ebcf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 8 additions & 0 deletions spec/coordinate-grid-chart-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,14 @@ describe('dc.coordinateGridChart', function() {
expect(chart.focus).toHaveBeenCalledWith(selectedRange);
});

it("should zoom the focus chart back out when range chart is un-brushed", function () {
rangeChart.brush().extent(selectedRange);
rangeChart.brush().event(rangeChart.g());
spyOn(chart, "focus");
rangeChart.filter(null);
expect(chart.focus).toHaveBeenCalledWith(null);
});

it("should update the range chart brush to match zoomed domain of focus chart", function () {
spyOn(rangeChart, "replaceFilter");
chart.focus(selectedRange);
Expand Down
13 changes: 6 additions & 7 deletions src/coordinate-grid-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,18 +993,17 @@ dc.coordinateGridMixin = function (_chart) {
if (!range1 && !range2) {
return true;
}

if (range1.length === 0 && range2.length === 0) {
else if (!range1 || !range2) {
return false;
}
else if (range1.length === 0 && range2.length === 0) {
return true;
}

if (range1 && range2 &&
range1[0].valueOf() === range2[0].valueOf() &&
else if (range1[0].valueOf() === range2[0].valueOf() &&
range1[1].valueOf() === range2[1].valueOf()) {
return true;
}

return false;
else return false;
}

/**
Expand Down

0 comments on commit 191ebcf

Please sign in to comment.