Files
iD/js/id/actions/move.js
T
John Firebaugh 9743ee282b More mode and action overhaul
Pass entities to actions via id; this allows safe composition
of actions that modify the same entity.

Fix remaining ghost node cases (#213).

Create more logical undo states when drawing.
2012-12-06 18:39:51 -05:00

9 lines
426 B
JavaScript

// https://github.com/openstreetmap/josm/blob/mirror/src/org/openstreetmap/josm/command/MoveCommand.java
// https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/MoveNodeAction.as
iD.actions.Move = function(entityId, loc) {
return function(graph) {
var entity = graph.entity(entityId);
return graph.replace(entity.update({loc: loc}), 'moved an element');
};
};