This commit is contained in:
John Firebaugh
2012-12-13 13:37:46 -08:00
parent 304a9c3603
commit 150dcf471e
2 changed files with 14 additions and 8 deletions
+6 -4
View File
@@ -95,8 +95,9 @@ iD.modes.DrawArea = function(wayId) {
controller.enter(iD.modes.Browse());
}
map.surface.on('mousemove.drawarea', mousemove);
map.surface.on('click.drawarea', click);
map.surface
.on('mousemove.drawarea', mousemove)
.on('click.drawarea', click);
map.keybinding()
.on('⎋.drawarea', esc)
@@ -106,8 +107,9 @@ iD.modes.DrawArea = function(wayId) {
};
mode.exit = function() {
mode.map.hint(false);
mode.map.fastEnable(true);
mode.map
.hint(false)
.fastEnable(true);
mode.map.surface
.on('mousemove.drawarea', null)
+8 -4
View File
@@ -24,11 +24,11 @@ iD.modes.DrawLine = function(wayId, direction) {
iD.actions.AddNode(node),
iD.actions.AddWayNode(wayId, node.id, index));
map.surface.on('mousemove.drawline', function() {
function mousemove() {
history.replace(iD.actions.Move(node.id, map.mouseCoordinates()));
});
}
map.surface.on('click.drawline', function() {
function click() {
var datum = d3.select(d3.event.target).datum() || {};
if (datum.id === tailId) {
@@ -72,7 +72,7 @@ iD.modes.DrawLine = function(wayId, direction) {
controller.enter(iD.modes.DrawLine(wayId, direction));
}
});
}
function esc() {
history.replace(
@@ -108,6 +108,10 @@ iD.modes.DrawLine = function(wayId, direction) {
controller.enter(iD.modes.Browse());
}
map.surface
.on('mousemove.drawline', mousemove)
.on('click.drawline', click);
map.keybinding()
.on('⎋.drawline', esc)
.on('⌫.drawline', backspace)