mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
31 lines
799 B
JavaScript
31 lines
799 B
JavaScript
import { t } from '../util/locale';
|
|
import { Reverse as ReverseAction } from '../actions/index';
|
|
export function Reverse(selectedIDs, context) {
|
|
var entityId = selectedIDs[0];
|
|
|
|
var operation = function() {
|
|
context.perform(
|
|
ReverseAction(entityId),
|
|
t('operations.reverse.annotation'));
|
|
};
|
|
|
|
operation.available = function() {
|
|
return selectedIDs.length === 1 &&
|
|
context.geometry(entityId) === 'line';
|
|
};
|
|
|
|
operation.disabled = function() {
|
|
return false;
|
|
};
|
|
|
|
operation.tooltip = function() {
|
|
return t('operations.reverse.description');
|
|
};
|
|
|
|
operation.id = 'reverse';
|
|
operation.keys = [t('operations.reverse.key')];
|
|
operation.title = t('operations.reverse.title');
|
|
|
|
return operation;
|
|
}
|