mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 22:48:10 +02:00
Chain
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user