Fix standard problem when writing backward loops

This commit is contained in:
Inez Korczynski 2011-11-08 01:00:31 +00:00
parent a0acc98bcb
commit 18b97268fc

View file

@ -78,7 +78,7 @@ es.DocumentModel.operations = ( function() {
// Regenerate nodes for the data we've affected
var newNodes = es.DocumentModel.createNodesFromData( newData );
// Insert new elements into the tree where the old ones used to be
for ( var i = newNodes.length; i >= 0; i-- ) {
for ( var i = newNodes.length - 1; i >= 0; i-- ) {
parent.splice( index, 0, newNodes[i] );
}
}