mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Added render from offset support
This commit is contained in:
parent
ab44388220
commit
187eca34eb
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue