From d4524d2ef585d467b37ee40e864b75a1062e84b6 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 11 Jan 2013 15:32:25 -0500 Subject: [PATCH] Fix area closing (no duplicate nodes at end of way) --- js/id/modes/draw_area.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/js/id/modes/draw_area.js b/js/id/modes/draw_area.js index c579abbab..d868a7620 100644 --- a/js/id/modes/draw_area.js +++ b/js/id/modes/draw_area.js @@ -41,22 +41,8 @@ iD.modes.DrawArea = function(wayId) { function click() { var datum = d3.select(d3.event.target).datum() || {}; - if (datum.id === tailId) { - history.replace( - iD.actions.DeleteNode(node.id), - iD.actions.AddWayNode(way.id, tailId, -1), - 'added to an area'); - - controller.enter(iD.modes.Select(way)); - - } else if (datum.id === headId) { - - // finish the way - history.replace( - iD.actions.DeleteNode(node.id), - iD.actions.AddWayNode(way.id, tailId, -1), - 'added to an area'); - + if (datum.id === tailId || datum.id === headId) { + history.replace(iD.actions.DeleteNode(node.id)); controller.enter(iD.modes.Select(way)); } else if (datum.type === 'node' && datum.id !== node.id) {