Files
iD/modules/modes/draw_area.js
Quincy Morgan 8883c2f36d Fix uiFlash issues
Clean up a few things from prior commit
2020-09-22 12:19:54 -04:00

38 lines
875 B
JavaScript

import { t } from '../core/localizer';
import { behaviorDrawWay } from '../behavior/draw_way';
export function modeDrawArea(context, wayID, startGraph, button) {
var mode = {
button: button,
id: 'draw-area'
};
var behavior = behaviorDrawWay(context, wayID, mode, startGraph)
.on('rejectedSelfIntersection.modeDrawArea', function() {
context.ui().flash
.iconName('#iD-icon-no')
.label(t('self_intersection.error.areas'))();
});
mode.wayID = wayID;
mode.enter = function() {
context.install(behavior);
};
mode.exit = function() {
context.uninstall(behavior);
};
mode.selectedIDs = function() {
return [wayID];
};
mode.activeID = function() {
return (behavior && behavior.activeID()) || [];
};
return mode;
}