Merge "Fix method hasSlugAtOffset to return true when length of the element is 0"

This commit is contained in:
Catrope 2012-06-21 02:00:51 +00:00 committed by Gerrit Code Review
commit 319ff040bb

View file

@ -197,6 +197,9 @@ ve.ce.BranchNode.prototype.onSplice = function( index, howmany ) {
};
ve.ce.BranchNode.prototype.hasSlugAtOffset = function( offset ) {
if ( this.getLength() === 0 ) {
return true;
}
for ( var i = 0; i < this.children.length; i++ ) {
if ( this.children[i].canHaveSlug() ) {
var nodeOffset = this.children[i].model.getRoot().getOffsetFromNode( this.children[i].model );