浏览代码

Merge pull request #24 from ckeditor/t/23

Changed name and order of arguments when using Batch methods
Szymon Cofalik 9 年之前
父节点
当前提交
7f6ffb53f3

+ 1 - 1
packages/ckeditor5-undo/tests/redocommand.js

@@ -65,7 +65,7 @@ describe( 'RedoCommand', () => {
 			editor.document.selection.setRanges( [ r( 2, 4 ) ], true );
 			batch1 = doc.batch();
 			undo.addBatch( batch1 );
-			batch1.setAttr( 'key', 'value', r( 2, 4 ) );
+			batch1.setAttribute( r( 2, 4 ), 'key', 'value' );
 			/*
 			 [root]
 			 - f

+ 4 - 4
packages/ckeditor5-undo/tests/undocommand.js

@@ -55,7 +55,7 @@ describe( 'UndoCommand', () => {
 			editor.document.selection.setRanges( [ r( 2, 4 ) ], true );
 			batch1 = doc.batch();
 			undo.addBatch( batch1 );
-			batch1.setAttr( 'key', 'value', r( 2, 4 ) );
+			batch1.setAttribute( r( 2, 4 ), 'key', 'value' );
 			/*
 			 [root]
 			 - f
@@ -293,7 +293,7 @@ describe( 'UndoCommand', () => {
 			editor.document.selection.setRanges( [ r( 0, 3 ) ] );
 			let batch2 = doc.batch();
 			undo.addBatch( batch2 );
-			batch2.setAttr( 'uppercase', true, r( 0, 3 ) );
+			batch2.setAttribute( r( 0, 3 ), 'uppercase', true );
 			expect( getCaseText( root ) ).to.equal( 'EBCdf' );
 
 			undo._execute( batch0 );
@@ -325,7 +325,7 @@ describe( 'UndoCommand', () => {
 			editor.document.selection.setRanges( [ r( 1, 4 ) ] );
 			let batch0 = doc.batch();
 			undo.addBatch( batch0 );
-			batch0.setAttr( 'uppercase', true, r( 1, 4 ) );
+			batch0.setAttribute( r( 1, 4 ), 'uppercase', true );
 			expect( getCaseText( root ) ).to.equal( 'aBCDef' );
 
 			editor.document.selection.setRanges( [ r( 3, 4 ) ] );
@@ -350,7 +350,7 @@ describe( 'UndoCommand', () => {
 			editor.document.selection.setRanges( [ r( 0, 1 ) ] );
 			let batch0 = doc.batch();
 			undo.addBatch( batch0 );
-			batch0.setAttr( 'uppercase', true, r( 0, 1 ) );
+			batch0.setAttribute( r( 0, 1 ), 'uppercase', true );
 			expect( getCaseText( root ) ).to.equal( 'Abcdef' );
 
 			doc.history.removeDelta( 0 );

+ 1 - 1
packages/ckeditor5-undo/tests/undoengine-integration.js

@@ -204,7 +204,7 @@ describe( 'UndoEngine integration', () => {
 		it( 'attributes then insert inside then undo', () => {
 			input( '<p>fo<selection>ob</selection>ar</p>' );
 
-			doc.batch().setAttr( 'bold', true, doc.selection.getFirstRange() );
+			doc.batch().setAttribute( doc.selection.getFirstRange(), 'bold', true );
 			output( '<p>fo<selection><$text bold=true>ob</$text></selection>ar</p>' );
 
 			setSelection( [ 0, 3 ], [ 0, 3 ] );