mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-19 17:43:39 +00:00
They're something distinct from actions. Actions are independent of UI, operations are actions + UI (title, keybinding, modality, etc.)
22 lines
497 B
JavaScript
22 lines
497 B
JavaScript
iD.operations.Reverse = function(entityId) {
|
|
var operation = function(history) {
|
|
history.perform(
|
|
iD.actions.ReverseWay(entityId),
|
|
'reversed a line');
|
|
};
|
|
|
|
operation.available = function(graph) {
|
|
var entity = graph.entity(entityId);
|
|
return entity.geometry(graph) === 'line';
|
|
};
|
|
|
|
operation.enabled = function() {
|
|
return true;
|
|
};
|
|
|
|
operation.id = "reverse";
|
|
operation.title = "Reverse";
|
|
|
|
return operation;
|
|
};
|