mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-26 23:43:46 +00:00
33 lines
1015 B
JavaScript
33 lines
1015 B
JavaScript
iD.operations.Circularize = function(selection, context) {
|
|
var entityId = selection[0],
|
|
geometry = context.geometry(entityId),
|
|
action = iD.actions.Circularize(entityId, context.projection);
|
|
|
|
var operation = function() {
|
|
var annotation = t('operations.circularize.annotation.' + geometry);
|
|
context.perform(action, annotation);
|
|
};
|
|
|
|
operation.available = function() {
|
|
return selection.length === 1 &&
|
|
context.entity(entityId).type === 'way';
|
|
};
|
|
|
|
operation.disabled = function() {
|
|
return action.disabled(context.graph());
|
|
};
|
|
|
|
operation.tooltip = function() {
|
|
var disable = operation.disabled();
|
|
return disable ?
|
|
t('operations.circularize.' + disable) :
|
|
t('operations.circularize.description.' + geometry);
|
|
};
|
|
|
|
operation.id = "circularize";
|
|
operation.keys = [t('operations.circularize.key')];
|
|
operation.title = t('operations.circularize.title');
|
|
|
|
return operation;
|
|
};
|