Files
iD/modules/operations/flipHorizontal.js
T
2016-11-05 19:36:53 +00:00

34 lines
895 B
JavaScript

import { t } from '../util/locale';
import { actionFlip } from '../actions/index';
import { uiCmd } from '../ui/index';
export function operationFlipHorizontal(selectedIDs, context) {
var entityId = selectedIDs[0];
var operation = function() {
context.perform(
actionFlip(entityId, false, context.projection),
t('operations.flipHorizontal.annotation')
);
};
operation.available = function() {
return selectedIDs.length === 1 &&
context.geometry(entityId) === 'area';
};
operation.disabled = function() {
return false;
};
operation.tooltip = function() {
return t('operations.flipHorizontal.description');
};
operation.id = 'flipHorizontal';
operation.keys = [uiCmd('⌥H')]; // Alt-H
operation.title = t('operations.flipHorizontal.title');
return operation;
}