Fix for method of retrieving anchor node in ve.ce.BranchNode.onSplice method.

In current implementation ve.ce.TextNode can be represented by more then one DOM node (TEXT_NODE and or ELEMENT_NODE) - for instance "Lorem <b>Ipsum</b> est" (TEXT, ELEMENT, TEXT).

Change-Id: I6530cbf1273ad1b1de3599c3eb929eb7abc2d59e
This commit is contained in:
Inez Korczynski 2012-08-23 13:34:09 -07:00
parent 832292182e
commit 06a5e30c72

View file

@ -204,7 +204,7 @@ ve.ce.BranchNode.prototype.onSplice = function ( index ) {
if ( args.length >= 3 ) {
if ( index ) {
// Get the element before the insertion point
$anchor = this.$.children(':not(.ve-ce-slug)').eq( index - 1 );
$anchor = this.children[ index - 1 ].$.last();
}
for ( i = args.length - 1; i >= 2; i-- ) {
args[i].attach( this );