Fix issue where preset browser would show after continuing a line (close #5770)

This commit is contained in:
Quincy Morgan
2019-01-28 08:52:20 -05:00
parent 3a48b3b57c
commit 1066f8f788
3 changed files with 6 additions and 5 deletions

View File

@@ -317,8 +317,8 @@ export function behaviorDrawWay(context, wayId, index, mode, startGraph) {
window.setTimeout(function() {
context.map().dblclickEnable(true);
}, 1000);
context.enter(modeSelect(context, [wayId]).newFeature(true));
var isNewFeature = !mode.isContinuing;
context.enter(modeSelect(context, [wayId]).newFeature(isNewFeature));
};

View File

@@ -2,7 +2,7 @@ import { t } from '../util/locale';
import { behaviorDrawWay } from '../behavior';
export function modeDrawLine(context, wayID, startGraph, affix) {
export function modeDrawLine(context, wayID, startGraph, affix, continuing) {
var mode = {
button: 'line',
id: 'draw-line'
@@ -10,13 +10,14 @@ export function modeDrawLine(context, wayID, startGraph, affix) {
var behavior;
mode.isContinuing = continuing;
mode.enter = function() {
var way = context.entity(wayID);
var index = (affix === 'prefix') ? 0 : undefined;
var headID = (affix === 'prefix') ? way.first() : way.last();
behavior = behaviorDrawWay(context, wayID, index, mode, startGraph)
behavior = behaviorDrawWay(context, wayID, index, mode, startGraph, continuing)
.tail(t('modes.draw_line.tail'));
var addNode = behavior.addNode;

View File

@@ -27,7 +27,7 @@ export function operationContinue(selectedIDs, context) {
var operation = function() {
var candidate = candidateWays()[0];
context.enter(
modeDrawLine(context, candidate.id, context.graph(), candidate.affix(vertex.id))
modeDrawLine(context, candidate.id, context.graph(), candidate.affix(vertex.id), true)
);
};