Skip to content

Commit

Permalink
Renamed the "executeCleanup" to "_executeCleanup". Now the event is m…
Browse files Browse the repository at this point in the history
…arked as private.
  • Loading branch information
pomek committed Aug 19, 2020
1 parent eaed650 commit 0143084
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
7 changes: 4 additions & 3 deletions packages/ckeditor5-list/src/indentcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class IndentCommand extends Command {
* Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
*
* @fires execute
* @fires executeCleanup
* @fires _executeCleanup
*/
execute() {
const model = this.editor.model;
Expand Down Expand Up @@ -98,9 +98,10 @@ export default class IndentCommand extends Command {
* It allows to execute an action after executing the {@link ~IndentCommand#execute} method, e.g. adjusting
* attributes of changed list items.
*
* @event executeCleanup
* @private
* @event _executeCleanup
*/
this.fire( 'executeCleanup', itemsToChange );
this.fire( '_executeCleanup', itemsToChange );
} );
}

Expand Down
5 changes: 3 additions & 2 deletions packages/ckeditor5-list/src/listcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ export default class ListCommand extends Command {
* It allows to execute an action after executing the {@link ~ListCommand#execute} method, e.g. adjusting
* attributes of changed blocks.
*
* @event executeCleanup
* @private
* @event _executeCleanup
*/
this.fire( 'executeCleanup', blocks );
this.fire( '_executeCleanup', blocks );
} );
}

Expand Down
8 changes: 4 additions & 4 deletions packages/ckeditor5-list/src/liststyleediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ export default class ListStyleEditing extends Plugin {
editor.commands.add( 'listStyle', new ListStyleCommand( editor, DEFAULT_LIST_TYPE ) );

// Fix list attributes when modifying their nesting levels (the `listIndent` attribute).
this.listenTo( editor.commands.get( 'indentList' ), 'executeCleanup', fixListAfterIndentListCommand( editor ) );
this.listenTo( editor.commands.get( 'outdentList' ), 'executeCleanup', fixListAfterOutdentListCommand( editor ) );
this.listenTo( editor.commands.get( 'indentList' ), '_executeCleanup', fixListAfterIndentListCommand( editor ) );
this.listenTo( editor.commands.get( 'outdentList' ), '_executeCleanup', fixListAfterOutdentListCommand( editor ) );

this.listenTo( editor.commands.get( 'bulletedList' ), 'executeCleanup', restoreDefaultListStyle( editor ) );
this.listenTo( editor.commands.get( 'numberedList' ), 'executeCleanup', restoreDefaultListStyle( editor ) );
this.listenTo( editor.commands.get( 'bulletedList' ), '_executeCleanup', restoreDefaultListStyle( editor ) );
this.listenTo( editor.commands.get( 'numberedList' ), '_executeCleanup', restoreDefaultListStyle( editor ) );

// Register a post-fixer that ensures that the `listStyle` attribute is specified in each `listItem` element.
model.document.registerPostFixer( fixListStyleAttributeOnListItemElements( editor ) );
Expand Down
4 changes: 2 additions & 2 deletions packages/ckeditor5-list/tests/indentcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ describe( 'IndentCommand', () => {
);
} );

it( 'should fire "executeCleanup" event after finish all operations with all changed items', done => {
it( 'should fire "_executeCleanup" event after finish all operations with all changed items', done => {
model.change( writer => {
writer.setSelection( root.getChild( 1 ), 0 );
} );

command.on( 'executeCleanup', ( evt, data ) => {
command.on( '_executeCleanup', ( evt, data ) => {
expect( data ).to.deep.equal( [
root.getChild( 1 ),
root.getChild( 2 ),
Expand Down
4 changes: 2 additions & 2 deletions packages/ckeditor5-list/tests/listcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ describe( 'ListCommand', () => {
} );
} );

it( 'should fire "executeCleanup" event after finish all operations with all changed items', done => {
it( 'should fire "_executeCleanup" event after finish all operations with all changed items', done => {
setData( model,
'<paragraph>Foo 1.</paragraph>' +
'<paragraph>[Foo 2.</paragraph>' +
Expand All @@ -472,7 +472,7 @@ describe( 'ListCommand', () => {
'<paragraph>Foo 4.</paragraph>'
);

command.on( 'executeCleanup', ( evt, data ) => {
command.on( '_executeCleanup', ( evt, data ) => {
expect( data ).to.deep.equal( [
root.getChild( 2 ),
root.getChild( 1 )
Expand Down

0 comments on commit 0143084

Please sign in to comment.