Skip to content

Commit

Permalink
fix(equalizer): good cursor item when user interact with chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Jacquin committed Mar 31, 2019
1 parent 3faa8ee commit 4bff6b9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/components/Equalizer/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ function getChartOptions(data) {
type: 'line',
data,
options: {
events: ['mousemove', 'click', 'mousedown'],
events: ['mousemove', 'mousedown'],
onHover: (event, chartElement) => {
event.target.style.cursor = chartElement[0] ? 'grab' : 'default';
switch (event.type) {
case 'mousedown':
event.target.style.cursor = chartElement[0] ? 'grabbing' : 'default';
break;
default:
event.target.style.cursor = chartElement[0] ? 'grab' : 'default';
}
},
responsive: true,
legend: {
Expand Down

0 comments on commit 4bff6b9

Please sign in to comment.