Show preset browser when adding generic point, line, or area

This commit is contained in:
Quincy Morgan
2019-03-01 09:07:41 -05:00
parent 3c1bf2d74a
commit 5ed5a7536b
2 changed files with 8 additions and 5 deletions

View File

@@ -330,7 +330,8 @@ export function behaviorDrawWay(context, wayID, index, mode, startGraph, baselin
window.setTimeout(function() {
context.map().dblclickEnable(true);
}, 1000);
var isNewFeature = !mode.isContinuing && mode.button.indexOf('add-preset-') === -1;
var isNewFeature = !mode.isContinuing && context.presets().match(origWay, context.graph()).isFallback();
context.enter(modeSelect(context, [wayID]).newFeature(isNewFeature));
if (isNewFeature) {
context.validator().validate();

View File

@@ -35,9 +35,7 @@ export function modeAddPoint(context, customMode) {
t('operations.add.annotation.point')
);
context.enter(
modeSelect(context, [node.id]).newFeature(!mode.preset)
);
enterSelectMode(node);
}
@@ -49,8 +47,12 @@ export function modeAddPoint(context, customMode) {
t('operations.add.annotation.vertex')
);
enterSelectMode(node);
}
function enterSelectMode(node) {
context.enter(
modeSelect(context, [node.id]).newFeature(!mode.preset)
modeSelect(context, [node.id]).newFeature(mode.preset.isFallback())
);
}