mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.2 KiB
2.2 KiB
UndoManager
This module allows to manage the stack of changes applied in canvas
You can access the module in this way
const um = editor.UndoManager;
getConfig
Get module configurations
Examples
const config = um.getConfig();
// { ... }
Returns Object Configuration object
add
Add an entity (Model/Collection) to track Note: New Components and CSSRules will be added automatically
Parameters
entity(Model | Collection) Entity to track
Examples
um.add(someModelOrCollection);
Returns this
remove
Remove and stop tracking the entity (Model/Collection)
Parameters
entity(Model | Collection) Entity to remove
Examples
um.remove(someModelOrCollection);
Returns this
removeAll
Remove all entities
Examples
um.removeAll();
Returns this
start
Start/resume tracking changes
Examples
um.start();
Returns this
stop
Stop tracking changes
Examples
um.stop();
Returns this
undo
Undo last change
Examples
um.undo();
Returns this
undoAll
Undo all changes
Examples
um.undoAll();
Returns this
redo
Redo last change
Examples
um.redo();
Returns this
redoAll
Redo all changes
Examples
um.redoAll();
Returns this
hasUndo
Checks if exists an available undo
Examples
um.hasUndo();
Returns Boolean
hasRedo
Checks if exists an available redo
Examples
um.hasRedo();
Returns Boolean
getStack
Get stack of changes
Examples
const stack = um.getStack();
stack.each(item => ...);
Returns Collection
clear
Clear the stack
Examples
um.clear();
Returns this