Files
iD/js/id/operations/split.js
John Firebaugh 988bfeb767 Support both delete and backspace (fixes #887)
Also show correct key in operation tooltip.
2013-03-04 17:12:44 -08:00

27 lines
819 B
JavaScript

iD.operations.Split = function(selection, context) {
var entityId = selection[0],
action = iD.actions.Split(entityId);
var operation = function() {
var annotation = t('operations.split.annotation'),
difference = context.perform(action, annotation);
context.enter(iD.modes.Select(context, difference.extantIDs()));
};
operation.available = function() {
return selection.length === 1 &&
context.geometry(entityId) === 'vertex';
};
operation.enabled = function() {
return action.enabled(context.graph());
};
operation.id = "split";
operation.keys = [t('operations.split.key')];
operation.title = t('operations.split.title');
operation.description = t('operations.split.description');
return operation;
};