Fixed passing global offset to emit event, preventing render from re-rendering because it thought the render-from point was well past it's length

This commit is contained in:
Trevor Parscal 2011-11-17 18:54:52 +00:00
parent 284082b5d3
commit a0d7c14238

View file

@ -275,7 +275,8 @@ es.TransactionProcessor.prototype.remove = function( op ) {
// Update the linear model
this.model.data.splice( this.cursor, op.data.length );
// Emit an update so things sync up
node.emit( 'update', this.cursor );
var offset = this.model.getOffsetFromNode( node );
node.emit( 'update', this.cursor - offset );
}
};