summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2014-12-04 20:14:47 +0200
committerAlon Levy <alon@pobox.com>2014-12-04 20:14:47 +0200
commit36f5289bae034bab100b7b520f9c018f66c16bc8 (patch)
tree60e90fc4911786b6a8c68cfc84b991ca43aeb4c1 /src
parent9b31c43e1309edf80993b62580e039e2f438cd34 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/rz_core.js10
1 files changed, 10 insertions, 0 deletions
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();