Files
iD/js/id/operations/reverse.js
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
677 B
JavaScript

iD.operations.Reverse = function(selection, context) {
var entityId = selection[0];
var operation = function() {
context.perform(
iD.actions.ReverseWay(entityId),
t('operations.reverse.annotation'));
};
operation.available = function() {
return selection.length === 1 &&
context.geometry(entityId) === 'line';
};
operation.enabled = function() {
return true;
};
operation.id = "reverse";
operation.key = t('operations.reverse.key');
operation.title = t('operations.reverse.title');
operation.description = t('operations.reverse.description');
return operation;
};