8
0
Quellcode durchsuchen

Changes: `core.Command` should listen to `model.Document#event:change`.

Szymon Cofalik vor 8 Jahren
Ursprung
Commit
12eaeeec33

+ 2 - 2
packages/ckeditor5-core/src/command.js

@@ -66,7 +66,7 @@ export default class Command {
 		this.decorate( 'execute' );
 
 		// By default every command is refreshed when changes are applied to the model.
-		this.listenTo( this.editor.model.document, 'changesDone', () => {
+		this.listenTo( this.editor.model.document, 'change', () => {
 			this.refresh();
 		} );
 
@@ -99,7 +99,7 @@ export default class Command {
 	 * in this method.
 	 *
 	 * This method is automatically called when
-	 * {@link module:engine/model/document~Document#event:changesDone any changes are applied to the model}.
+	 * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.
 	 */
 	refresh() {
 		this.isEnabled = true;

+ 2 - 2
packages/ckeditor5-core/tests/command.js

@@ -34,10 +34,10 @@ describe( 'Command', () => {
 			expect( command.isEnabled ).to.be.false;
 		} );
 
-		it( 'adds a listener which refreshed the command on editor.model.document#changesDone', () => {
+		it( 'adds a listener which refreshes the command on editor.model.Document#event:change', () => {
 			sinon.spy( command, 'refresh' );
 
-			editor.model.document.fire( 'changesDone' );
+			editor.model.document.fire( 'change' );
 
 			expect( command.refresh.calledOnce ).to.be.true;
 		} );