ソースを参照

Renamed methods. API docs fixes.

Maciej Bukowski 6 年 前
コミット
07b5c68265

+ 4 - 4
packages/ckeditor5-engine/src/model/document.js

@@ -303,8 +303,8 @@ export default class Document {
 	 * @fires change:data
 	 * @param {module:engine/model/writer~Writer writer} writer The writer on which post-fixers will be called.
 	 */
-	_runPostFixersAndResetDiffer( writer ) {
-		if ( this._hasDocumentChanged() ) {
+	_handleChangeBlock( writer ) {
+		if ( this._hasDocumentChangedFromTheLastChangeBlock() ) {
 			this._callPostFixers( writer );
 
 			if ( this.differ.hasDataChanges() ) {
@@ -325,9 +325,9 @@ export default class Document {
 	 * or {@link module:engine/model/model~Model#change `change()` block}.
 	 *
 	 * @protected
-	 * @returns {Boolean} Returns `true` if document has changed from the differ's reset.
+	 * @returns {Boolean} Returns `true` if document has changed from the last `change()` or `enqueueChange()` block.
 	 */
-	_hasDocumentChanged() {
+	_hasDocumentChangedFromTheLastChangeBlock() {
 		return !this.differ.isEmpty || this._hasSelectionChangedFromTheLastChangeBlock;
 	}
 

+ 2 - 2
packages/ckeditor5-engine/src/model/model.js

@@ -697,12 +697,12 @@ export default class Model {
 			ret.push( callbackReturnValue );
 
 			// Collect an information whether the model document has changed during from the last pending change.
-			hasModelDocumentChanged = hasModelDocumentChanged || this.document._hasDocumentChanged();
+			hasModelDocumentChanged = hasModelDocumentChanged || this.document._hasDocumentChangedFromTheLastChangeBlock();
 
 			// Fire '_change' event before resetting differ.
 			this.fire( '_change', this._currentWriter );
 
-			this.document._runPostFixersAndResetDiffer( this._currentWriter );
+			this.document._handleChangeBlock( this._currentWriter );
 
 			this._pendingChanges.shift();
 			this._currentWriter = null;