Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make vertex by midpoint double-clicking #3687

Merged
merged 1 commit into from
Dec 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/behavior/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
9 changes: 9 additions & 0 deletions modules/modes/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down