Files
iD/js/id/operations/circularize.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

32 lines
1001 B
JavaScript

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