diff --git a/js/id/modes/move_way.js b/js/id/modes/move_way.js index 7fe07d1ce..1f559da82 100644 --- a/js/id/modes/move_way.js +++ b/js/id/modes/move_way.js @@ -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(); };