diff --git a/modules/ve2/ce/ve.ce.Surface.js b/modules/ve2/ce/ve.ce.Surface.js index 0a741a2ef4..271728b366 100644 --- a/modules/ve2/ce/ve.ce.Surface.js +++ b/modules/ve2/ce/ve.ce.Surface.js @@ -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 diff --git a/modules/ve2/ui/tools/ve.ui.FormatDropdownTool.js b/modules/ve2/ui/tools/ve.ui.FormatDropdownTool.js index 0bd7eeb9c1..dec727f11a 100644 --- a/modules/ve2/ui/tools/ve.ui.FormatDropdownTool.js +++ b/modules/ve2/ui/tools/ve.ui.FormatDropdownTool.js @@ -74,7 +74,7 @@ ve.FormatDropdownTool.prototype.onSelect = function( item ) { item.type, item.attributes ); - model.transact ( txs ); + model.change( txs ); surfaceView.showSelection( selection ); }; diff --git a/modules/ve2/ui/tools/ve.ui.IndentationButtonTool.js b/modules/ve2/ui/tools/ve.ui.IndentationButtonTool.js index 29df89de8f..f13136b2b5 100644 --- a/modules/ve2/ui/tools/ve.ui.IndentationButtonTool.js +++ b/modules/ve2/ui/tools/ve.ui.IndentationButtonTool.js @@ -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(); diff --git a/modules/ve2/ui/tools/ve.ui.ListButtonTool.js b/modules/ve2/ui/tools/ve.ui.ListButtonTool.js index dbe29dba16..82e6f97bb8 100644 --- a/modules/ve2/ui/tools/ve.ui.ListButtonTool.js +++ b/modules/ve2/ui/tools/ve.ui.ListButtonTool.js @@ -83,7 +83,7 @@ ve.ui.ListButtonTool.prototype.unlist = function( node ){ [] ); - model.transact ( tx ); + model.change( tx ); }; ve.ui.ListButtonTool.prototype.onClick = function() { diff --git a/tests/ve2/dm/ve.dm.Surface.test.js b/tests/ve2/dm/ve.dm.Surface.test.js index 6acfee15c1..bdc6f52bea 100644 --- a/tests/ve2/dm/ve.dm.Surface.test.js +++ b/tests/ve2/dm/ve.dm.Surface.test.js @@ -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(){ ); } -}); \ No newline at end of file +} );