Fixes for 44fe109f14 which mistakingly added .children to a few uses of batchedSplice

Change-Id: I2c876a66b64c6f1ae3cbd1577b7e1102618997ba
This commit is contained in:
Trevor Parscal 2012-04-27 15:08:15 -07:00
parent 44fe109f14
commit 0245f6a6a8
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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 */