tinymce.UndoManager

Namespace tinymce
Class UndoManager
This class handles the undo/redo history levels for the editor. Since the build in undo/redo has major drawbacks a custom one was needed.

Public Methods

Method Defined By
add(l:Object):Object
Adds a new undo level/snapshot to the undo list.
UndoManager
clear():void
Removes all undo levels.
UndoManager
hasRedo():Boolean
Returns true/false if the undo manager has any redo levels.
UndoManager
hasUndo():Boolean
Returns true/false if the undo manager has any undo levels.
UndoManager
redo():Object
Redoes the last action.
UndoManager
undo():Object
Undoes the last action.
UndoManager

Method details

addmethod

public function add(l:Object):Object
Adds a new undo level/snapshot to the undo list.

Parameters

l:Object Optional undo level object to add.

Returns

Object - Undo level that got added or null it a level wasn't needed.

clearmethod

public function clear():void
Removes all undo levels.

hasRedomethod

public function hasRedo():Boolean
Returns true/false if the undo manager has any redo levels.

Returns

Boolean - true/false if the undo manager has any redo levels.

hasUndomethod

public function hasUndo():Boolean
Returns true/false if the undo manager has any undo levels.

Returns

Boolean - true/false if the undo manager has any undo levels.

redomethod

public function redo():Object
Redoes the last action.

Returns

Object - Redo level or null if no redo was performed.

undomethod

public function undo():Object
Undoes the last action.

Returns

Object - Undo level or null if no undo was performed.