Explorar o código

Changed: use engine.model.Batch#constructor to set up batch type.

Szymon Cofalik %!s(int64=9) %!d(string=hai) anos
pai
achega
7a7df0185c

+ 1 - 2
packages/ckeditor5-undo/src/redocommand.js

@@ -30,8 +30,7 @@ export default class RedoCommand extends BaseCommand {
 		const item = this._items.pop();
 
 		// All changes done by the command execution will be saved as one batch.
-		const newBatch = this.editor.document.batch();
-		newBatch.type = 'redo';
+		const newBatch = this.editor.document.batch( 'redo' );
 
 		// All changes have to be done in one `enqueueChanges` callback so other listeners will not
 		// step between consecutive deltas, or won't do changes to the document before selection is properly restored.

+ 1 - 2
packages/ckeditor5-undo/src/undocommand.js

@@ -35,8 +35,7 @@ export default class UndoCommand extends BaseCommand {
 		const item = this._items.splice( batchIndex, 1 )[ 0 ];
 
 		// All changes done by the command execution will be saved as one batch.
-		const newBatch = this.editor.document.batch();
-		newBatch.type = 'undo';
+		const newBatch = this.editor.document.batch( 'undo' );
 
 		// All changes has to be done in one `enqueueChanges` callback so other listeners will not
 		// step between consecutive deltas, or won't do changes to the document before selection is properly restored.