From 14f42e86219278fbdf819f4b58b87825ed3ba9b5 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Fri, 4 Sep 2009 06:36:37 +0000 Subject: [PATCH] Fix Issue 172: ensure the selector manager is re-initialized upon clearing the document git-svn-id: http://svg-edit.googlecode.com/svn/trunk@556 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index e80afc40..17da92c5 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -411,8 +411,8 @@ function BatchCommand(text) { // local reference to this object var mgr = this; - // private function - var initGroup = function() { + + this.initGroup = function() { mgr.selectorParentGroup = addSvgElementFromJson({ "element": "g", "attr": {"id": "selectorParentGroup"} @@ -489,7 +489,7 @@ function BatchCommand(text) { return this.rubberBandBox; }; - initGroup(); + this.initGroup(); } // ************************************************************************************** @@ -669,7 +669,6 @@ function BatchCommand(text) { } undoStack.push(cmd); undoStackPointer = undoStack.length; - console.log(undoStack); }; // private functions @@ -2317,6 +2316,8 @@ function BatchCommand(text) { } // clear the undo stack resetUndoStack(); + // reset the selector manager + selectorManager.initGroup(); call("cleared"); };