Adapted to spacing convention & added doc comments
This commit is contained in:
parent
6316e64394
commit
b298b58d9f
@ -253,7 +253,7 @@
|
||||
* @param {UndoManager} manager The UndoManager-instance on which an "undo"/"redo"-Event is triggered afterwards
|
||||
* @param {UndoStack} stack The UndoStack on which we perform
|
||||
* @param {Boolean} magic If true, undoes / redoes all actions with the same magicFusionIndex
|
||||
* @param {Boolean} everything If true, undoes / redoes every actions that have been tracked
|
||||
* @param {Boolean} everything If true, undoes / redoes every action that had been tracked
|
||||
* @return {undefined}
|
||||
*/
|
||||
function managerUndoRedo (which, manager, stack, magic, everything) {
|
||||
@ -273,10 +273,11 @@
|
||||
stack.pointer++;
|
||||
action = stack.at(stack.pointer);
|
||||
}
|
||||
if (everything)
|
||||
if (everything) {
|
||||
actions = _.clone(stack.models);
|
||||
else
|
||||
} else {
|
||||
actions = magic ? stack.where({"magicFusionIndex": action.get("magicFusionIndex")}) : [action];
|
||||
}
|
||||
|
||||
stack.pointer += (isUndo ? -1 : 1) * (actions.length - 1);
|
||||
while (action = isUndo ? actions.pop() : actions.shift()) {
|
||||
@ -681,6 +682,10 @@
|
||||
managerUndoRedo("undo", this, this.stack, magic);
|
||||
},
|
||||
|
||||
/**
|
||||
* Undoes all actions ever tracked by the undo manager
|
||||
* @return {undefined}
|
||||
*/
|
||||
undoAll: function () {
|
||||
managerUndoRedo("undo", this, this.stack, false, true);
|
||||
},
|
||||
@ -694,6 +699,10 @@
|
||||
managerUndoRedo("redo", this, this.stack, magic);
|
||||
},
|
||||
|
||||
/**
|
||||
* Redoes all actions ever tracked by the undo manager
|
||||
* @return {undefined}
|
||||
*/
|
||||
redoAll: function () {
|
||||
managerUndoRedo("redo", this, this.stack, false, true);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user