From 9006a746be0f0569528c746cb90c1723daade176 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 6 Dec 2012 16:00:06 -0500 Subject: [PATCH] Fixing stray last node. --- js/id/modes/draw_road.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/js/id/modes/draw_road.js b/js/id/modes/draw_road.js index 4ea9a55b4..b61c24c70 100644 --- a/js/id/modes/draw_road.js +++ b/js/id/modes/draw_road.js @@ -4,12 +4,12 @@ iD.modes.DrawRoad = function(way_id, direction) { }; mode.enter = function() { - mode.map.dblclickEnable(false); - mode.map.hint('Click to add more points to the road. ' + + mode.map.dblclickEnable(false) + .dragEnable(false) + .fastEnable(false) + .hint('Click to add more points to the road. ' + 'Click on other roads to connect to them, and double-click to ' + 'end the road.'); - mode.map.dragEnable(false); - mode.map.fastEnable(false); var index = (direction === 'forward') ? undefined : -1, node = iD.Node({loc: mode.map.mouseCoordinates(), tags: { elastic: true } }), @@ -47,6 +47,8 @@ iD.modes.DrawRoad = function(way_id, direction) { mode.history.graph().entity(lastNode), index)); } + mode.history.replace(iD.actions.DeleteNode(node)); + return finish(iD.modes.Select(way)); } else { // connect a way to an existing way @@ -87,8 +89,8 @@ iD.modes.DrawRoad = function(way_id, direction) { }; mode.exit = function() { - mode.map.hint(false); - mode.map.fastEnable(true); + mode.map.hint(false).fastEnable(true); + mode.map.surface .on('mousemove.drawroad', null) .on('click.drawroad', null);