From 1abffc6f8a4b1a1444ba772a5b023ef139ce9de4 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 14 Dec 2012 13:45:53 -0500 Subject: [PATCH] Finish areas on double-click. Fixes #272 --- js/id/modes/draw_area.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/id/modes/draw_area.js b/js/id/modes/draw_area.js index c7d91e158..687f5496c 100644 --- a/js/id/modes/draw_area.js +++ b/js/id/modes/draw_area.js @@ -38,6 +38,16 @@ iD.modes.DrawArea = function(wayId) { 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'); + + controller.enter(iD.modes.Select(way)); + } else if (datum.type === 'node' && datum.id !== node.id) { // connect the way to an existing node history.replace(