mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Fixed remaining uses of transact to change
Change-Id: I63c8fb183be8b37db85ed386d7bf33633e821f80
This commit is contained in:
parent
d6dd113d8d
commit
ca4f19c726
|
@ -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
|
||||
|
|
|
@ -74,7 +74,7 @@ ve.FormatDropdownTool.prototype.onSelect = function( item ) {
|
|||
item.type,
|
||||
item.attributes
|
||||
);
|
||||
model.transact ( txs );
|
||||
model.change( txs );
|
||||
surfaceView.showSelection( selection );
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -83,7 +83,7 @@ ve.ui.ListButtonTool.prototype.unlist = function( node ){
|
|||
[]
|
||||
);
|
||||
|
||||
model.transact ( tx );
|
||||
model.change( tx );
|
||||
|
||||
};
|
||||
ve.ui.ListButtonTool.prototype.onClick = function() {
|
||||
|
|
|
@ -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(){
|
|||
);
|
||||
|
||||
}
|
||||
});
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue