Files
iD/js/id/operations/split.js
John Firebaugh 402a9424c0 Make selection an array of entity IDs
Should have no visible effect yet.
2013-01-31 13:51:12 -05:00

29 lines
832 B
JavaScript

iD.operations.Split = function(selection, mode) {
var entityId = selection[0],
history = mode.map.history(),
action = iD.actions.SplitWay(entityId);
var operation = function() {
history.perform(action, t('operations.split.annotation'));
};
operation.available = function() {
var graph = history.graph(),
entity = graph.entity(entityId);
return selection.length === 1 &&
entity.geometry(graph) === 'vertex';
};
operation.enabled = function() {
var graph = history.graph();
return action.enabled(graph);
};
operation.id = "split";
operation.key = t('operations.split.key');
operation.title = t('operations.split.title');
operation.description = t('operations.split.description');
return operation;
};