Fixed remaining uses of transact to change

Change-Id: I63c8fb183be8b37db85ed386d7bf33633e821f80
This commit is contained in:
Trevor Parscal 2012-06-18 22:05:05 -07:00
parent d6dd113d8d
commit ca4f19c726
5 changed files with 12 additions and 10 deletions

View file

@ -581,7 +581,7 @@ return;
from + sourceNode.model.getOuterLength()
);
tx = ve.dm.Transaction.newFromRemoval( this.documentView.model, range );
this.model.transact( tx );
this.model.change( tx );
}
} else {
// selection removal

View file

@ -74,7 +74,7 @@ ve.FormatDropdownTool.prototype.onSelect = function( item ) {
item.type,
item.attributes
);
model.transact ( txs );
model.change( txs );
surfaceView.showSelection( selection );
};

View file

@ -50,7 +50,7 @@ ve.ui.IndentationButtonTool.prototype.indent = function( listItems ) {
'styles',
styles.concat( styles[styles.length - 1] )
);
surface.model.transact( tx );
surface.model.change( tx );
}
}
surface.emitCursor();
@ -69,7 +69,7 @@ ve.ui.IndentationButtonTool.prototype.outdent = function( listItems ) {
'styles',
styles.slice( 0, styles.length - 1 )
);
surface.model.transact( tx );
surface.model.change( tx );
}
}
surface.emitCursor();

View file

@ -83,7 +83,7 @@ ve.ui.ListButtonTool.prototype.unlist = function( node ){
[]
);
model.transact ( tx );
model.change( tx );
};
ve.ui.ListButtonTool.prototype.onClick = function() {

View file

@ -35,17 +35,19 @@ test( 'setSelection', 1, function() {
surface.setSelection( new ve.Range( 1, 1 ) );
} );
test( 'transact', 1, function() {
test( 'change', 2, function() {
var surface = new ve.dm.SurfaceStub();
var tx = new ve.dm.Transaction();
surface.on( 'transact', function() {
ok( true, 'transact was emitted' );
} );
surface.transact( tx );
surface.on( 'change', function() {
ok( true, 'change was emitted' );
} );
surface.change( tx );
} );
test('annotate', 1, function(){
test( 'annotate', 1, function() {
var surface,
cases = [
{
@ -105,4 +107,4 @@ test('annotate', 1, function(){
);
}
});
} );