From 1066f8f78886b7fd2dccabcf389cf0e2f257bd9f Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Mon, 28 Jan 2019 08:52:20 -0500 Subject: [PATCH] Fix issue where preset browser would show after continuing a line (close #5770) --- modules/behavior/draw_way.js | 4 ++-- modules/modes/draw_line.js | 5 +++-- modules/operations/continue.js | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/behavior/draw_way.js b/modules/behavior/draw_way.js index e99da7b32..d980bc26b 100644 --- a/modules/behavior/draw_way.js +++ b/modules/behavior/draw_way.js @@ -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)); }; diff --git a/modules/modes/draw_line.js b/modules/modes/draw_line.js index a9f5b0e49..9c6fc0109 100644 --- a/modules/modes/draw_line.js +++ b/modules/modes/draw_line.js @@ -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; diff --git a/modules/operations/continue.js b/modules/operations/continue.js index 53c92db7a..37ccdd40d 100644 --- a/modules/operations/continue.js +++ b/modules/operations/continue.js @@ -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) ); };