From 73b2b93bab23059315b661faef02d3878664198d Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 24 Sep 2010 16:44:20 +0000 Subject: [PATCH] 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-75d572ba1ddd --- editor/svgcanvas.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 4194999c..4b4b531c 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -950,22 +950,22 @@ var BatchCommand = this.undoCmd.batch = function(text) { this.isEmpty = function() { return this.stack.length == 0; }; } -// Set scope for these undo functions -var resetUndoStack, addCommandToHistory; +// Set scope for addCommandToHistory +var addCommandToHistory; // Undo/redo stack related functions (function(c) { var undoStackPointer = 0, undoStack = []; - // Function: resetUndoStack - // Resets the undo stack, effectively clearing the undo/redo history - resetUndoStack = function() { - undoStack = []; - undoStackPointer = 0; - }; - c.undoMgr = { + // Function: undoMgr.resetUndoStack + // Resets the undo stack, effectively clearing the undo/redo history + resetUndoStack: function() { + undoStack = []; + undoStackPointer = 0; + }, + // Function: undoMgr.getUndoStackSize // Returns: // Integer with the current size of the undo history stack @@ -9086,7 +9086,7 @@ this.clear = function() { canvas.createLayer("Layer 1"); // clear the undo stack - resetUndoStack(); + canvas.undoMgr.resetUndoStack(); // reset the selector manager selectorManager.initGroup(); // reset the rubber band box