mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Merge pull request #5070 from AndreasHae/master
Handle key-value pairs pasted as tags
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import _map from 'lodash-es/map';
|
||||
import _includes from 'lodash-es/includes';
|
||||
|
||||
import { ascending as d3_ascending } from 'd3-array';
|
||||
import { dispatch as d3_dispatch } from 'd3-dispatch';
|
||||
@@ -281,6 +282,15 @@ export function uiRawTagEditor(context) {
|
||||
while (_tags[kNew]) { // rename key if already in use
|
||||
kNew = base + '_' + suffix++;
|
||||
}
|
||||
|
||||
if (_includes(kNew, '=')) {
|
||||
var splitStr = kNew.split('=').map(function(str) { return str.trim(); }),
|
||||
key = splitStr[0],
|
||||
value = splitStr[1];
|
||||
|
||||
kNew = key;
|
||||
d.value = value;
|
||||
}
|
||||
}
|
||||
tag[kOld] = undefined;
|
||||
tag[kNew] = d.value;
|
||||
|
||||
Reference in New Issue
Block a user