Fix duplicate not working for arrays anymore
This commit is contained in:
parent
6ccf5c651d
commit
19a625fa6e
|
@ -123,8 +123,10 @@ function History (editor) {
|
|||
var nodes = params.paths.map(findNode);
|
||||
nodes.forEach(function (node) {
|
||||
var clone = node.clone();
|
||||
var existingFieldNames = parentNode.getFieldNames();
|
||||
clone.field = util.findUniqueName(node.field, existingFieldNames);
|
||||
if (parentNode.type === 'object') {
|
||||
var existingFieldNames = parentNode.getFieldNames();
|
||||
clone.field = util.findUniqueName(node.field, existingFieldNames);
|
||||
}
|
||||
parentNode.insertAfter(clone, afterNode);
|
||||
afterNode = clone;
|
||||
});
|
||||
|
|
|
@ -3508,8 +3508,10 @@ Node.onDuplicate = function(nodes) {
|
|||
var afterNode = lastNode;
|
||||
var clones = nodes.map(function (node) {
|
||||
var clone = node.clone();
|
||||
var existingFieldNames = node.parent.getFieldNames();
|
||||
clone.field = util.findUniqueName(node.field, existingFieldNames);
|
||||
if (node.parent.type === 'object') {
|
||||
var existingFieldNames = node.parent.getFieldNames();
|
||||
clone.field = util.findUniqueName(node.field, existingFieldNames);
|
||||
}
|
||||
parent.insertAfter(clone, afterNode);
|
||||
afterNode = clone;
|
||||
return clone;
|
||||
|
|
Loading…
Reference in New Issue