Procházet zdrojové kódy

Renamed the "executeCleanup" to "_executeCleanup". Now the event is marked as private.

Kamil Piechaczek před 5 roky
rodič
revize
0143084436

+ 4 - 3
packages/ckeditor5-list/src/indentcommand.js

@@ -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;
@@ -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 );
 		} );
 	}
 

+ 3 - 2
packages/ckeditor5-list/src/listcommand.js

@@ -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 );
 		} );
 	}
 

+ 4 - 4
packages/ckeditor5-list/src/liststyleediting.js

@@ -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 ) );

+ 2 - 2
packages/ckeditor5-list/tests/indentcommand.js

@@ -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 ),

+ 2 - 2
packages/ckeditor5-list/tests/listcommand.js

@@ -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>' +
@@ -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 )