Fix click suppression in d3 zoom behavior

This should be included in the next version of d3
This commit is contained in:
Ansis Brammanis
2013-03-28 13:18:58 -04:00
parent dcaa10fda6
commit 92ceae911c

10
js/lib/d3.v3.js vendored
View File

@@ -3926,7 +3926,13 @@ d3 = function() {
function mouseup() {
if (moved) d3_eventCancel();
w.on("mousemove.zoom", null).on("mouseup.zoom", null);
if (moved && d3.event.target === eventTarget) w.on("click.zoom", click, true);
if (moved && d3.event.target === eventTarget) {
w.on("click.zoom", click, true);
window.setTimeout(function() {
// Remove click block if click didn't fire
w.on("click.zoom", null);
}, 0);
}
}
function click() {
d3_eventCancel();
@@ -8167,4 +8173,4 @@ d3 = function() {
return d3_time_scale(d3.scale.linear(), d3_time_scaleUTCMethods, d3_time_scaleUTCFormat);
};
return d3;
}();
}();