From 06a5e30c72cf79d1372ec91b82c8e59bfeac6baa Mon Sep 17 00:00:00 2001 From: Inez Korczynski Date: Thu, 23 Aug 2012 13:34:09 -0700 Subject: [PATCH] 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 Ipsum est" (TEXT, ELEMENT, TEXT). Change-Id: I6530cbf1273ad1b1de3599c3eb929eb7abc2d59e --- modules/ve/ce/ve.ce.BranchNode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve/ce/ve.ce.BranchNode.js b/modules/ve/ce/ve.ce.BranchNode.js index cecc2f9b19..e09aabbfd5 100644 --- a/modules/ve/ce/ve.ce.BranchNode.js +++ b/modules/ve/ce/ve.ce.BranchNode.js @@ -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 );