mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
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:
parent
832292182e
commit
06a5e30c72
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue