Browse Source

Fix mouse event bug on multiple xs - #453

pull/475/head
Masayuki Tanaka 11 years ago
parent
commit
1d8184cf8e
  1. 4
      c3.js
  2. 2
      c3.min.js
  3. 1
      htdocs/samples/custom_xs_scale.html

4
c3.js

@ -3358,7 +3358,7 @@
__data_onmouseover.call(c3, closest); __data_onmouseover.call(c3, closest);
mouseover = true; mouseover = true;
} }
} else { } else if (mouseover) {
svg.select('.' + CLASS.eventRect).style('cursor', null); svg.select('.' + CLASS.eventRect).style('cursor', null);
__data_onmouseout.call(c3, closest); __data_onmouseout.call(c3, closest);
mouseover = false; mouseover = false;
@ -3377,7 +3377,7 @@
// select if selection enabled // select if selection enabled
if (dist(closest, mouse) < 100) { if (dist(closest, mouse) < 100) {
main.select('.' + CLASS.circles + '-' + getTargetSelectorSuffix(closest.id)).select('.' + CLASS.circle + '-' + closest.index).each(function () { main.select('.' + CLASS.circles + getTargetSelectorSuffix(closest.id)).select('.' + CLASS.circle + '-' + closest.index).each(function () {
toggleShape(this, closest, closest.index); toggleShape(this, closest, closest.index);
}); });
} }

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

1
htdocs/samples/custom_xs_scale.html

@ -24,6 +24,7 @@
selection: { selection: {
enabled: true enabled: true
}, },
onclick: function (d) { console.log("onclick", d); },
onmouseover: function (d) { console.log("onmouseover", d); }, onmouseover: function (d) { console.log("onmouseover", d); },
onmouseout: function (d) { console.log("onmouseout", d); } onmouseout: function (d) { console.log("onmouseout", d); }
} }

Loading…
Cancel
Save