mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
Move click-end-node-to-finish functionality from draw modes to behaviorDraw Fix issue where the head node would get hover-highlighted when continuing from the end of a line
37 lines
833 B
JavaScript
37 lines
833 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
|
|
.text(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;
|
|
}
|