From 36f5289bae034bab100b7b520f9c018f66c16bc8 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Thu, 4 Dec 2014 20:14:47 +0200 Subject: Fixes #170: dragging cancels search Clearly not the best way to do it: we have a zoom object, it probably already holds this state, and won't be inconsistent if we change the document click handler. Time pressure and all that. --- src/rz_core.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/rz_core.js b/src/rz_core.js index 13d298b2..0538d12d 100644 --- a/src/rz_core.js +++ b/src/rz_core.js @@ -178,15 +178,21 @@ function recenterZoom() { vis.attr("transform", "translate(0,0)scale(1)"); } +// zoom or drag +var zoomInProgress = false; + var initDrawingArea = function () { function zoom() { + zoomInProgress = true; if (graphstate === "GRAPH") { vis.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"); } if (graphstate === "TIMELINE") { vis.attr("transform", "translate(0,0)scale(1)"); } + console.log(arguments); + d3.event.sourceEvent.stopPropagation(); } function dragstarted(d) { @@ -726,6 +732,10 @@ function showNodeInfo(d, i) { } function overlay_mousedown() { + if (zoomInProgress) { + zoomInProgress = false; + return; + } svgInput.hide(); selection.clear(); view.hide(); -- cgit v1.3.1