Undo for Component Users
Options
The undo decorator can be customized by providing options in the componentDecorators object:
Name | Description | Values | Default |
|---|---|---|---|
| Javascript object containing selectors for various fragments of the Undo decorator | The object can contain any subset of the following keys: |
selectors: {
undoContainer: ".flc-undo-undoContainer",
undoControl: ".flc-undo-undoControl",
redoContainer: ".flc-undo-redoContainer",
redoControl: ".flc-undo-redoControl"
}
|
| a function that renders the markup for the undo controls |
|
function defaultRenderer(that, targetContainer) {
var markup = "<span class='flc-undo'>" +
"<span class='flc-undo-undoContainer'>[<a href='#' class='flc-undo-undoControl'>undo</a>]</span>" +
"<span class='flc-undo-redoContainer'>[<a href='#' class='flc-undo-redoControl'>redo</a>]</span>" +
"</span>";
var markupNode = $(markup);
targetContainer.append(markupNode);
return markupNode;
}
|
Dependencies
The Undo dependencies can be met by including the minified InfusionAll.js file in the header of the HTML file:
<script type="text/javascript" src="InfusionAll.js"></script>
Alternatively, the individual file requirements (in addition to those of the component) are:
<... other dependencies ...>
<script type="text/javascript" src="components/undo/js/Undo.js"></script>