Commit a1370f4e authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix arc focus from legend event - #652

parent c0f5426b
...@@ -3797,9 +3797,7 @@ ...@@ -3797,9 +3797,7 @@
}) })
.on('mouseout', function (id) { .on('mouseout', function (id) {
$$.d3.select(this).classed(CLASS.legendItemFocused, false); $$.d3.select(this).classed(CLASS.legendItemFocused, false);
if (!$$.transiting) {
$$.api.revert(); $$.api.revert();
}
if (config.legend_item_onmouseout) { if (config.legend_item_onmouseout) {
config.legend_item_onmouseout.call($$, id); config.legend_item_onmouseout.call($$, id);
} }
...@@ -4430,8 +4428,10 @@ ...@@ -4430,8 +4428,10 @@
interval = window.setInterval(function () { interval = window.setInterval(function () {
if (!$$.transiting) { if (!$$.transiting) {
window.clearInterval(interval); window.clearInterval(interval);
if ($$.legend.selectAll('.c3-legend-item-focused').size() > 0) {
$$.expandArc(targetIds); $$.expandArc(targetIds);
} }
}
}, 10); }, 10);
return; return;
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -127,8 +127,10 @@ c3_chart_internal_fn.expandArc = function (targetIds) { ...@@ -127,8 +127,10 @@ c3_chart_internal_fn.expandArc = function (targetIds) {
interval = window.setInterval(function () { interval = window.setInterval(function () {
if (!$$.transiting) { if (!$$.transiting) {
window.clearInterval(interval); window.clearInterval(interval);
if ($$.legend.selectAll('.c3-legend-item-focused').size() > 0) {
$$.expandArc(targetIds); $$.expandArc(targetIds);
} }
}
}, 10); }, 10);
return; return;
} }
......
...@@ -225,9 +225,7 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) { ...@@ -225,9 +225,7 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
}) })
.on('mouseout', function (id) { .on('mouseout', function (id) {
$$.d3.select(this).classed(CLASS.legendItemFocused, false); $$.d3.select(this).classed(CLASS.legendItemFocused, false);
if (!$$.transiting) {
$$.api.revert(); $$.api.revert();
}
if (config.legend_item_onmouseout) { if (config.legend_item_onmouseout) {
config.legend_item_onmouseout.call($$, id); config.legend_item_onmouseout.call($$, id);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment