Merge branch 'midpoints' of https://github.com/edpop/iD into edpop-midpoints

This commit is contained in:
Bryan Housel
2016-12-28 01:08:42 -05:00
2 changed files with 12 additions and 1 deletions

View File

@@ -27,7 +27,9 @@ export function behaviorSelect(context) {
lasso = d3.select('#surface .lasso').node(),
mode = context.mode();
if (!(datum instanceof osmEntity)) {
if (datum.type === 'midpoint') {
// do nothing
} else if (!(datum instanceof osmEntity)) {
if (!d3.event.shiftKey && !lasso && mode.id !== 'browse')
context.enter(modeBrowse(context));

View File

@@ -245,6 +245,15 @@ export function modeSelect(context, selectedIDs) {
t('operations.add.annotation.vertex')
);
d3.event.preventDefault();
d3.event.stopPropagation();
} else if (datum.type === 'midpoint') {
var node = osmNode();
context.perform(
actionAddMidpoint({loc: datum.loc, edge: datum.edge}, node),
t('operations.add.annotation.vertex'));
d3.event.preventDefault();
d3.event.stopPropagation();
}