Is there any ways to reset the undo history?
I'm trying to reuse the same editor instance, and i want to reset the undo history so that the end user can't undo past the last time setData() was invoked.
I'm trying to reuse the same editor instance, and i want to reset the undo history so that the end user can't undo past the last time setData() was invoked.
Re: is there a way to reset the undo history?
I couldn't see a way of resetting the undo states with out basically reloading the entire editor .. which I wanted to avoid. Why reload when you can reuse?
To get around the issue I had to add a newfunction to fckundo.js
calling FCKUndo.resetUndoState() now rests the undo history back to zero. So it does what i wanted ... but I really *really* wanted to avoid maintaining my own functions in the main code. Is there any chance of getting the function added to the main code base?
Re: is there a way to reset the undo history?
You can then call the reset using something like oEditor.ResetUndoState();
I also simplified the function in FCKundo.js
You need to call the FCK.Events.FireEvent( "OnSelectionChange" ) event if you use ResetUndoState inside a plugin. It's not needed if you call it through your instance reference (EG oEditor.ResetUndoState())
Anyways .. I post this in case anyone ever needs it in the future