Преглед на файлове

Merge branch t/ckeditor5-engine/1308

Internal: Align code to the selection API, introduced in engine t/1308.
Piotr Jasiun преди 7 години
родител
ревизия
58f72371f2
променени са 3 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 1 1
      packages/ckeditor5-undo/src/basecommand.js
  2. 1 1
      packages/ckeditor5-undo/tests/redocommand.js
  3. 1 1
      packages/ckeditor5-undo/tests/undocommand.js

+ 1 - 1
packages/ckeditor5-undo/src/basecommand.js

@@ -112,7 +112,7 @@ export default class BaseCommand extends Command {
 		// `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.
 		if ( selectionRanges.length ) {
 			model.change( writer => {
-				writer.setSelection( selectionRanges, isBackward );
+				writer.setSelection( selectionRanges, { backward: isBackward } );
 			} );
 		}
 	}

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

@@ -70,7 +70,7 @@ describe( 'RedoCommand', () => {
 				 */
 				// Let's make things spicy and this time, make a backward selection.
 				model.change( writer => {
-					writer.setSelection( r( 2, 4 ), true );
+					writer.setSelection( r( 2, 4 ), { backward: true } );
 				} );
 				batch1 = new Batch();
 				undo.addBatch( batch1 );

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

@@ -60,7 +60,7 @@ describe( 'UndoCommand', () => {
 				 */
 				// Let's make things spicy and this time, make a backward selection.
 				model.change( writer => {
-					writer.setSelection( r( 2, 4 ), true );
+					writer.setSelection( r( 2, 4 ), { backward: true } );
 				} );
 				batch1 = new Batch();
 				undo.addBatch( batch1 );