make vertex by midpoint double-clicking

This commit is contained in:
popov
2016-12-28 15:32:47 +10:00
parent 0c9fb7c407
commit 19b0a771f6
2 changed files with 12 additions and 1 deletions
+3 -1
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));
+9
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();
}