Files
iD/js/id/operations/circularize.js
T
John Firebaugh 7e68e8e114 Add iD.Context
This is a facade interface that ties together a bunch of
different internal objects and will make it easier to write
tests for behaviors, modes, and operations.
2013-02-01 12:40:15 -05:00

26 lines
813 B
JavaScript

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