Exit MoveWay mode on undo (fixes #562)

This commit is contained in:
John Firebaugh
2013-01-30 12:02:49 -05:00
parent 6576ec6501
commit 217577da95
+9
View File
@@ -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();
};