Added render from offset support

This commit is contained in:
Trevor Parscal 2011-11-07 19:42:36 +00:00
parent ab44388220
commit 187eca34eb
2 changed files with 6 additions and 4 deletions

View file

@ -111,7 +111,8 @@ es.DocumentModel.operations = ( function() {
es.insertIntoArray( this.data, this.cursor, op.data );
annotate.call( this, this.cursor + op.data.length );
// Update model tree
node.adjustContentLength( op.data.length );
node.adjustContentLength( op.data.length, true );
node.emit( update, this.cursor );
}
}
this.cursor += op.data.length;
@ -131,7 +132,8 @@ es.DocumentModel.operations = ( function() {
// Remove content from linear data model
this.data.splice( this.cursor, op.data.length );
// Update model tree
node.adjustContentLength( -op.data.length );
node.adjustContentLength( -op.data.length, true );
node.emit( update, this.cursor );
}
}
}

View file

@ -41,9 +41,9 @@ es.ContentView = function( $container, model ) {
if ( model ) {
// Events
var _this = this;
this.model.on( 'update', function( args ) {
this.model.on( 'update', function( offset ) {
_this.scanBoundaries();
_this.render( args ? args.offset : 0 );
_this.render( offset || 0 );
} );
// DOM Changes