Select way/area after hitting enter/escape

This commit is contained in:
Ansis Brammanis
2013-01-11 14:30:09 -05:00
parent 486c201a21
commit 87ee1cf0cb
2 changed files with 5 additions and 22 deletions

View File

@@ -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);
};

View File

@@ -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();