mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Merge tags instead of adding new point when adding a point to a point
Fix lint error
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import _clone from 'lodash-es/clone';
|
||||
|
||||
import { t } from '../util/locale';
|
||||
import { actionAddEntity } from '../actions';
|
||||
import { actionAddEntity, actionChangeTags } from '../actions';
|
||||
import { behaviorDraw } from '../behavior';
|
||||
import { modeBrowse, modeSelect } from './index';
|
||||
import { osmNode } from '../osm';
|
||||
@@ -53,7 +55,23 @@ export function modeAddPoint(context, mode) {
|
||||
|
||||
|
||||
function addNode(node) {
|
||||
add(node.loc);
|
||||
|
||||
if (Object.keys(defaultTags).length === 0) {
|
||||
enterSelectMode(node);
|
||||
return;
|
||||
}
|
||||
|
||||
var tags = _clone(node.tags);
|
||||
for (var key in defaultTags) {
|
||||
tags[key] = defaultTags[key];
|
||||
}
|
||||
|
||||
context.perform(
|
||||
actionChangeTags(node.id, tags),
|
||||
t('operations.add.annotation.point')
|
||||
);
|
||||
|
||||
enterSelectMode(node);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ export function uiModes(context) {
|
||||
button: markerClass,
|
||||
title: presetName,
|
||||
description: t(tooltipTitleID, { feature: presetName }),
|
||||
key: '',
|
||||
preset: preset,
|
||||
geometry: d.geom
|
||||
};
|
||||
|
||||
@@ -173,7 +173,7 @@ export function uiSearchAdd(context) {
|
||||
if (!selection.empty()) {
|
||||
selection.classed('focused', true);
|
||||
// scroll to keep the focused item visible
|
||||
scrollPopoverToShow(selection)
|
||||
scrollPopoverToShow(selection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user