0

Is there a way to programmatically execute undo and redo in CKEDITOR?

And the other question is: is there a way to reset the undo stack and also the redo stack?

Vito Gentile
  • 13,336
  • 9
  • 61
  • 96

1 Answers1

2

Undo:

editor.execCommand( 'undo' );

Redo:

editor.execCommand( 'redo' );

Reset:

editor.resetUndo();
Reinmar
  • 21,729
  • 4
  • 67
  • 78
  • Is there also a way to reset only the Redo part of the undo stack? – Vito Gentile Dec 06 '13 at 11:42
  • Nope. I mean... everything is doable, but you would have to check the [undoManager](https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/undo/plugin.js) code. There's no public API for this. – Reinmar Dec 07 '13 at 15:19
  • Thank you for your answer, and for the suggest about undoManager code ;) – Vito Gentile Dec 07 '13 at 15:44