From 0acab34054131544587b486c35ee6ee5cee73ae7 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Wed, 6 Feb 2013 15:06:50 -0500 Subject: [PATCH] Draw click event triggered by click instead of up --- js/id/behavior/draw.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/id/behavior/draw.js b/js/id/behavior/draw.js index a4fb53a1a..b0da771a4 100644 --- a/js/id/behavior/draw.js +++ b/js/id/behavior/draw.js @@ -27,7 +27,7 @@ iD.behavior.Draw = function(context) { target.on('mousemove.draw', null); - d3.select(window).on('mouseup.draw', function() { + d3.select(window).on('click.draw', function() { target.on('mousemove.draw', mousemove); if (iD.geo.dist(pos, point()) < closeTolerance || (iD.geo.dist(pos, point()) < tolerance && @@ -35,7 +35,6 @@ iD.behavior.Draw = function(context) { click(); } }); - } function mousemove() { @@ -111,7 +110,7 @@ iD.behavior.Draw = function(context) { .on('mousedown.draw', null) .on('mousemove.draw', null); - d3.select(window).on('mouseup.draw', null); + d3.select(window).on('click.draw', null); d3.select(document) .call(keybinding.off)