mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-26 07:23:40 +00:00
Select way/area after hitting enter/escape
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user