From a9de2500aaff8b5ba074bdd85a3db0f89afd11af Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Wed, 16 Jan 2013 12:43:29 -0500 Subject: [PATCH] Fix undo right after drawing line or area --- js/id/modes/draw_area.js | 2 +- js/id/modes/draw_line.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/id/modes/draw_area.js b/js/id/modes/draw_area.js index 75b84af65..88d61d323 100644 --- a/js/id/modes/draw_area.js +++ b/js/id/modes/draw_area.js @@ -43,7 +43,7 @@ iD.modes.DrawArea = function(wayId) { if (datum.id === tailId || datum.id === headId) { if (way.nodes.length > 3) { - history.replace(iD.actions.DeleteNode(node.id)); + history.undo(); controller.enter(iD.modes.Select(way)); } else { // Areas with less than 3 nodes gets deleted diff --git a/js/id/modes/draw_line.js b/js/id/modes/draw_line.js index 700944b18..a59e3a7e9 100644 --- a/js/id/modes/draw_line.js +++ b/js/id/modes/draw_line.js @@ -57,7 +57,7 @@ iD.modes.DrawLine = function(wayId, direction) { } else if (datum.id === headId) { // finish the way - history.replace(iD.actions.DeleteNode(node.id)); + history.undo(); controller.enter(iD.modes.Select(way));