Opened 12 years ago

Last modified 12 years ago

#10101 new Bug

afterUndo and afterRedo are fired on the commands

Reported by: Alfonso Martínez de Lizarrondo Owned by: Alfonso Martínez de Lizarrondo
Priority: Normal Milestone:
Component: Core : Undo & Redo Version: 3.0
Keywords: Cc:

Description

There are two events "afterUndo" and "afterRedo" that seem like good ways to be notified about when an undo/redo operation is performed but they are trickier to use because they aren't fired on the editor but on the commands themselves:

			var undoCommand = editor.addCommand( 'undo',
				{
					exec : function()
					{
						if ( undoManager.undo() )
						{
							editor.selectionChange();
							this.fire( 'afterUndo' );
						}
					},
					state : CKEDITOR.TRISTATE_DISABLED,
					canUndo : false
				});

			var redoCommand = editor.addCommand( 'redo',
				{
					exec : function()
					{
						if ( undoManager.redo() )
						{
							editor.selectionChange();
							this.fire( 'afterRedo' );
						}
					},
					state : CKEDITOR.TRISTATE_DISABLED,
					canUndo : false
				});

if instead of "this.fire" the code is "editor.fire" then they can be used in a normal way.

I think that this is just a typo that no one has realized so far (after all these events aren't documented in any way)

I don't think that anyone is using the current events so it shouldn't be a problem to correct them.

I guess that you won't bother about fixing this in 3.6 so I'll create a patch just for 4.0

Change History (1)

comment:1 Changed 12 years ago by Alfonso Martínez de Lizarrondo

Sorry this damn git is broken again, don't expect a patch for v4 from me.

Each day that I'm forced to use it I hate it a little bit more.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy