Files
iD/js/id/operations/unjoin.js
T
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
824 B
JavaScript

iD.operations.Unjoin = function(selection, mode) {
var entityId = selection[0],
history = mode.map.history(),
action = iD.actions.UnjoinNode(entityId);
var operation = function() {
history.perform(action, 'Unjoined lines.');
};
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 = "unjoin";
operation.key = t('operations.unjoin.key');
operation.title = t('operations.unjoin.title');
operation.description = t('operations.unjoin.description');
return operation;
};