Undo-History
From CSScripting
The Undo History Object
Properties
- history.maxLength
- An integer, indicating the number of steps in the undo history. Default is 5.
Methods
- history.add(model)
- Stores a copy of the model's DOMDocument in the history queue.
- history.removeLast()
- Removes the last entry in the history.
- history.undo()
- Restores an older DOMDocument from the history queue. The model's DOMDocument is replaced, so any existing references to it are lost and must be reassigned. For instance:
var xmlroot = model.get('document').documentElement;
var Controller.history.add(model);
var Controller.history.undo();
/* xmlroot is now null, so we reset it. */
xmlroot = model.get('document').documentElement;
- Note: This method is not fully tested.
- history.redo()
- Restores a newer DOMDocument from the history queue. Newer DOMDocuments can only be present in the history if the
undomethod has been called at least once before. - Note: This method is not fully implemented.
