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

Change-Id: Icf43eb6adfcc45eaf1ae8ff146a029546341ba33
This commit is contained in:
Inez Korczynski 2012-06-20 17:40:26 -07:00
parent a62e78292f
commit c1225acb68

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 );