With the `addUndoType()` method you can add or overwrite one or more UndoTypes. You can call it with the two arguments `type` and `callbacks` or with an object in which all keys are `type`s and their values `callbacks` to perform a bulk action.
@ -330,7 +330,7 @@ With the `addUndoType()` method you can add or overwrite one or more UndoTypes.
*Example*: If we want to overwrite the UndoType `"reset"` with the functions defined in the example above we can do the following:
Backbone.Undo.addUndoType("reset", {
Backbone.UndoManager.addUndoType("reset", {
"on": function (collection, options) {
…
},
@ -344,7 +344,7 @@ With the `addUndoType()` method you can add or overwrite one or more UndoTypes.
You can also define several UndoTypes at once by passing an object to `addUndoType`
Backbone.Undo.addUndoType({
Backbone.UndoManager.addUndoType({
"reset": {
"on": …
"undo": …
@ -364,19 +364,19 @@ You can also define several UndoTypes at once by passing an object to `addUndoTy
If you want to change just one or more functions of an already added or built-in UndoType `changeUndoType` is the way to go. It works just like `addUndoType` with the difference that there must already be an UndoType for the specified `type` and you don't have to pass all `callbacks` functions.
Backbone.Undo.changeUndoType("reset", {
Backbone.UndoManager.changeUndoType("reset", {
"condition": …
})
Pass an object to perform a bulk action:
Backbone.Undo.changeUndoType({
Backbone.UndoManager.changeUndoType({
"reset": {
"condition": …
},
@ -391,21 +391,21 @@ Pass an object to perform a bulk action:
#### removeUndoType
Backbone.Undo.removeUndoType(type);
Backbone.UndoManager.removeUndoType(type);
// or
Backbone.Undo.removeUndoType(types);
Backbone.UndoManager.removeUndoType(types);
Call `removeUndoType` to remove an existing UndoType. Pass the type of the UndoType you want to remove as the argument or pass an array of types if you want to remove several at once.