From c74615fa83a899332fd4412e3ba4fa0c160f25d0 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Tue, 5 Mar 2013 16:54:33 -0500 Subject: [PATCH] Only re-enable dblclick after done drawing way --- js/id/behavior/add_way.js | 9 +++++---- js/id/behavior/draw_way.js | 12 ++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/js/id/behavior/add_way.js b/js/id/behavior/add_way.js index 19f9437cd..450f5aae2 100644 --- a/js/id/behavior/add_way.js +++ b/js/id/behavior/add_way.js @@ -23,14 +23,15 @@ iD.behavior.AddWay = function(context) { .minzoom(0) .tail(false); - window.setTimeout(function() { - context.map().dblclickEnable(true); - }, 1000); - surface.call(draw.off); }; addWay.cancel = function() { + + window.setTimeout(function() { + context.map().dblclickEnable(true); + }, 1000); + context.enter(iD.modes.Browse(context)); }; diff --git a/js/id/behavior/draw_way.js b/js/id/behavior/draw_way.js index a9a34e37c..359e5a9ea 100644 --- a/js/id/behavior/draw_way.js +++ b/js/id/behavior/draw_way.js @@ -87,10 +87,6 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) { .minzoom(0) .tail(false); - window.setTimeout(function() { - context.map().dblclickEnable(true); - }, 1000); - surface.call(draw.off) .selectAll('.way, .node') .classed('active', false); @@ -159,6 +155,10 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) { context.pop(); finished = true; + window.setTimeout(function() { + context.map().dblclickEnable(true); + }, 1000); + var way = context.entity(wayId); if (way) { context.enter(iD.modes.Select(context, [way.id], true)); @@ -173,6 +173,10 @@ iD.behavior.DrawWay = function(context, wayId, index, mode, baseGraph) { d3.functor(baseGraph), t('operations.cancel_draw.annotation')); + window.setTimeout(function() { + context.map().dblclickEnable(true); + }, 1000); + finished = true; context.enter(iD.modes.Browse(context)); };