From 87ee1cf0cb0e703e60e419df953186fc211a7671 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 11 Jan 2013 14:30:09 -0500 Subject: [PATCH] Select way/area after hitting enter/escape --- js/id/modes/draw_area.js | 16 +++------------- js/id/modes/draw_line.js | 11 ++--------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/js/id/modes/draw_area.js b/js/id/modes/draw_area.js index d1ebe3ef0..c579abbab 100644 --- a/js/id/modes/draw_area.js +++ b/js/id/modes/draw_area.js @@ -77,13 +77,6 @@ iD.modes.DrawArea = function(wayId) { } } - function esc() { - history.replace( - iD.actions.DeleteNode(node.id)); - - controller.enter(iD.modes.Browse()); - } - function backspace() { d3.event.preventDefault(); @@ -109,11 +102,8 @@ iD.modes.DrawArea = function(wayId) { function ret() { d3.event.preventDefault(); - history.replace( - iD.actions.DeleteNode(node.id), - iD.actions.AddWayNode(way.id, tailId, -1), - 'added to an area'); - controller.enter(iD.modes.Browse()); + history.replace(iD.actions.DeleteNode(node.id)); + controller.enter(iD.modes.Select(way)); } surface @@ -122,9 +112,9 @@ iD.modes.DrawArea = function(wayId) { .on('click.drawarea', click); map.keybinding() - .on('⎋.drawarea', esc) .on('⌫.drawarea', backspace) .on('⌦.drawarea', del) + .on('⎋.drawarea', ret) .on('↩.drawarea', ret); }; diff --git a/js/id/modes/draw_line.js b/js/id/modes/draw_line.js index 7400de80f..e55474270 100644 --- a/js/id/modes/draw_line.js +++ b/js/id/modes/draw_line.js @@ -90,13 +90,6 @@ iD.modes.DrawLine = function(wayId, direction) { } } - function esc() { - history.replace( - iD.actions.DeleteNode(node.id)); - - controller.enter(iD.modes.Browse()); - } - function backspace() { d3.event.preventDefault(); @@ -121,7 +114,7 @@ iD.modes.DrawLine = function(wayId, direction) { function ret() { d3.event.preventDefault(); history.replace(iD.actions.DeleteNode(node.id)); - controller.enter(iD.modes.Browse()); + controller.enter(iD.modes.Select(way)); } function undo() { @@ -134,9 +127,9 @@ iD.modes.DrawLine = function(wayId, direction) { .on('click.drawline', click); map.keybinding() - .on('⎋.drawline', esc) .on('⌫.drawline', backspace) .on('⌦.drawline', del) + .on('⎋.drawline', ret) .on('↩.drawline', ret) .on('z.drawline', function(evt, mods) { if (mods === '⌘' || mods === '⌃') undo();