mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Fix method hasSlugAtOffset to return true when length of the element is 0
Change-Id: Icf43eb6adfcc45eaf1ae8ff146a029546341ba33
This commit is contained in:
parent
a62e78292f
commit
c1225acb68
|
@ -197,6 +197,9 @@ ve.ce.BranchNode.prototype.onSplice = function( index, howmany ) {
|
||||||
};
|
};
|
||||||
|
|
||||||
ve.ce.BranchNode.prototype.hasSlugAtOffset = function( offset ) {
|
ve.ce.BranchNode.prototype.hasSlugAtOffset = function( offset ) {
|
||||||
|
if ( this.getLength() === 0 ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for ( var i = 0; i < this.children.length; i++ ) {
|
for ( var i = 0; i < this.children.length; i++ ) {
|
||||||
if ( this.children[i].canHaveSlug() ) {
|
if ( this.children[i].canHaveSlug() ) {
|
||||||
var nodeOffset = this.children[i].model.getRoot().getOffsetFromNode( this.children[i].model );
|
var nodeOffset = this.children[i].model.getRoot().getOffsetFromNode( this.children[i].model );
|
||||||
|
|
Loading…
Reference in a new issue