Fixed issue 691 by making resetUndoStack public through svgCanvas.undoMgr
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1750 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
c363097f50
commit
73b2b93bab
|
@ -950,22 +950,22 @@ var BatchCommand = this.undoCmd.batch = function(text) {
|
||||||
this.isEmpty = function() { return this.stack.length == 0; };
|
this.isEmpty = function() { return this.stack.length == 0; };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set scope for these undo functions
|
// Set scope for addCommandToHistory
|
||||||
var resetUndoStack, addCommandToHistory;
|
var addCommandToHistory;
|
||||||
|
|
||||||
// Undo/redo stack related functions
|
// Undo/redo stack related functions
|
||||||
(function(c) {
|
(function(c) {
|
||||||
var undoStackPointer = 0,
|
var undoStackPointer = 0,
|
||||||
undoStack = [];
|
undoStack = [];
|
||||||
|
|
||||||
// Function: resetUndoStack
|
|
||||||
// Resets the undo stack, effectively clearing the undo/redo history
|
|
||||||
resetUndoStack = function() {
|
|
||||||
undoStack = [];
|
|
||||||
undoStackPointer = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
c.undoMgr = {
|
c.undoMgr = {
|
||||||
|
// Function: undoMgr.resetUndoStack
|
||||||
|
// Resets the undo stack, effectively clearing the undo/redo history
|
||||||
|
resetUndoStack: function() {
|
||||||
|
undoStack = [];
|
||||||
|
undoStackPointer = 0;
|
||||||
|
},
|
||||||
|
|
||||||
// Function: undoMgr.getUndoStackSize
|
// Function: undoMgr.getUndoStackSize
|
||||||
// Returns:
|
// Returns:
|
||||||
// Integer with the current size of the undo history stack
|
// Integer with the current size of the undo history stack
|
||||||
|
@ -9086,7 +9086,7 @@ this.clear = function() {
|
||||||
canvas.createLayer("Layer 1");
|
canvas.createLayer("Layer 1");
|
||||||
|
|
||||||
// clear the undo stack
|
// clear the undo stack
|
||||||
resetUndoStack();
|
canvas.undoMgr.resetUndoStack();
|
||||||
// reset the selector manager
|
// reset the selector manager
|
||||||
selectorManager.initGroup();
|
selectorManager.initGroup();
|
||||||
// reset the rubber band box
|
// reset the rubber band box
|
||||||
|
|
Loading…
Reference in New Issue