mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Fixes for 44fe109f14
which mistakingly added .children to a few uses of batchedSplice
Change-Id: I2c876a66b64c6f1ae3cbd1577b7e1102618997ba
This commit is contained in:
parent
44fe109f14
commit
0245f6a6a8
|
@ -58,7 +58,7 @@ ve.dm.Document.prototype.rebuildNodes = function( parent, index, numNodes, offse
|
|||
// Get generated child nodes from the document fragment
|
||||
var nodes = fragment.getRootNode().getChildren();
|
||||
// Replace nodes in the model tree
|
||||
ve.batchedSplice( parent.children, index, numNodes, nodes );
|
||||
ve.batchedSplice( parent, index, numNodes, nodes );
|
||||
// Update offset map
|
||||
ve.batchedSplice( this.offsetMap, offset, oldLength, fragment.getOffsetMap() );
|
||||
// Return inserted nodes
|
||||
|
|
|
@ -100,9 +100,9 @@ ve.dm.DocumentFragment = function( data, parentDocument ) {
|
|||
children = stack.pop();
|
||||
currentStack = parentStack;
|
||||
parentStack = stack[stack.length - 2];
|
||||
// Attach the children to the node
|
||||
// Attach the children to the node (but don't try and splice 0 children into a leaf)
|
||||
if ( children.length ) {
|
||||
ve.batchedSplice( currentNode.children, 0, 0, children );
|
||||
ve.batchedSplice( currentNode, 0, 0, children );
|
||||
}
|
||||
currentNode = parentStack[parentStack.length - 1];
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ ve.dm.DocumentFragment = function( data, parentDocument ) {
|
|||
}
|
||||
// The end state is stack = [ [this.rootNode] [ array, of, its, children ] ]
|
||||
// so attach all nodes in stack[1] to the root node
|
||||
ve.batchedSplice( this.rootNode.children, 0, 0, stack[1] );
|
||||
ve.batchedSplice( this.rootNode, 0, 0, stack[1] );
|
||||
};
|
||||
|
||||
/* Methods */
|
||||
|
|
Loading…
Reference in a new issue