mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-20 10:03:29 +00:00
They're something distinct from actions. Actions are independent of UI, operations are actions + UI (title, keybinding, modality, etc.)
22 lines
510 B
JavaScript
22 lines
510 B
JavaScript
iD.operations.Split = function(entityId) {
|
|
var action = iD.actions.SplitWay(entityId);
|
|
|
|
var operation = function(history) {
|
|
history.perform(action, 'split a way');
|
|
};
|
|
|
|
operation.available = function(graph) {
|
|
var entity = graph.entity(entityId);
|
|
return entity.geometry(graph) === 'vertex';
|
|
};
|
|
|
|
operation.enabled = function(graph) {
|
|
return action.enabled(graph);
|
|
};
|
|
|
|
operation.id = "split";
|
|
operation.title = "Split";
|
|
|
|
return operation;
|
|
};
|