mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-08 04:11:23 +00:00
Fix issue where preset browser would show after continuing a line (close #5770)
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user