Merge pull request #5070 from AndreasHae/master

Handle key-value pairs pasted as tags
This commit is contained in:
Bryan Housel
2018-06-11 21:27:58 -04:00
committed by GitHub
+10
View File
@@ -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;