8
0
Просмотр исходного кода

Changed: Batch.type available values reduced to 'transparent' and 'default'.

Szymon Cofalik 9 лет назад
Родитель
Сommit
b8bc37cae9

+ 1 - 1
packages/ckeditor5-engine/src/datacontroller.js

@@ -172,7 +172,7 @@ export default class DataController {
 
 		this.model.enqueueChanges( () => {
 			// Initial batch should be ignored by features like undo, etc.
-			this.model.batch( 'ignore' )
+			this.model.batch( 'transparent' )
 				.remove( ModelRange.createFromElement( modelRoot ) )
 				.insert( ModelPosition.createAt( modelRoot, 0 ), this.parse( data ) );
 		} );

+ 4 - 6
packages/ckeditor5-engine/src/model/batch.js

@@ -35,7 +35,7 @@ export default class Batch {
 	 * Creates Batch instance. Not recommended to use directly, use {@link engine.model.Document#batch} instead.
 	 *
 	 * @param {engine.model.Document} doc Document which this Batch changes.
-	 * @param {'ignore'|'undo'|'redo'|'default'} [type='default'] Type of the batch.
+	 * @param {'transparent'|'default'} [type='default'] Type of the batch.
 	 */
 	constructor( doc, type = 'default' ) {
 		/**
@@ -58,13 +58,11 @@ export default class Batch {
 		 * Type of the batch.
 		 *
 		 * Can be one of the following values:
-		 * * `'default'` - all "normal" batches. Most commonly used type.
-		 * * `'undo'` - batch created by undo command.
-		 * * `'redo'` - batch created by redo command.
-		 * * `'ignore'` - batch that should be ignored by other features.
+		 * * `'default'` - all "normal" batches, most commonly used type.
+		 * * `'transparent'` - batch that should be ignored by other features, i.e. initial batch or collaborative editing changes.
 		 *
 		 * @readonly
-		 * @member {'ignore'|'undo'|'redo'|'default'} engine.model.Batch#type
+		 * @member {'transparent'|'default'} engine.model.Batch#type
 		 */
 		this.type = type;
 	}