Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 912570d

Browse files
author
Piotr Jasiun
authored
Merge pull request #111 from ckeditor/t/ckeditor5-engine/1207
Other: `core.Command` should listen to `model.Document#event:change`.
2 parents fcb0a71 + 153dda6 commit 912570d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class Command {
6666
this.decorate( 'execute' );
6767

6868
// By default every command is refreshed when changes are applied to the model.
69-
this.listenTo( this.editor.model.document, 'changesDone', () => {
69+
this.listenTo( this.editor.model.document, 'change', () => {
7070
this.refresh();
7171
} );
7272

@@ -99,7 +99,7 @@ export default class Command {
9999
* in this method.
100100
*
101101
* This method is automatically called when
102-
* {@link module:engine/model/document~Document#event:changesDone any changes are applied to the model}.
102+
* {@link module:engine/model/document~Document#event:change any changes are applied to the document}.
103103
*/
104104
refresh() {
105105
this.isEnabled = true;

tests/command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ describe( 'Command', () => {
3434
expect( command.isEnabled ).to.be.false;
3535
} );
3636

37-
it( 'adds a listener which refreshed the command on editor.model.document#changesDone', () => {
37+
it( 'adds a listener which refreshes the command on editor.model.Document#event:change', () => {
3838
sinon.spy( command, 'refresh' );
3939

40-
editor.model.document.fire( 'changesDone' );
40+
editor.model.document.fire( 'change' );
4141

4242
expect( command.refresh.calledOnce ).to.be.true;
4343
} );

0 commit comments

Comments
 (0)