mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-25 09:34:04 +02:00
Exit MoveWay mode on undo (fixes #562)
This commit is contained in:
@@ -42,10 +42,16 @@ iD.modes.MoveWay = function(wayId) {
|
||||
controller.enter(iD.modes.Select(way, true));
|
||||
}
|
||||
|
||||
function undone() {
|
||||
controller.enter(iD.modes.Browse());
|
||||
}
|
||||
|
||||
selection
|
||||
.on('mousemove.move-way', move)
|
||||
.on('click.move-way', finish);
|
||||
|
||||
history.on('undone.move-way', undone);
|
||||
|
||||
keybinding
|
||||
.on('⎋', cancel)
|
||||
.on('↩', finish);
|
||||
@@ -56,12 +62,15 @@ iD.modes.MoveWay = function(wayId) {
|
||||
|
||||
mode.exit = function() {
|
||||
var map = mode.map,
|
||||
history = mode.history,
|
||||
selection = map.surface;
|
||||
|
||||
selection
|
||||
.on('mousemove.move-way', null)
|
||||
.on('click.move-way', null);
|
||||
|
||||
history.on('undone.move-way', null);
|
||||
|
||||
keybinding.off();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user