From 91a348412e1a716e745be7e5314f18411458640c Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Tue, 22 Sep 2009 18:29:15 +0000 Subject: [PATCH] Fix bug where contextual panel was not being updated after deleting an element git-svn-id: http://svg-edit.googlecode.com/svn/trunk@680 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index ea4d5a64..86da138e 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1304,14 +1304,15 @@ function BatchCommand(text) { // public events this.clearSelection = function() { - if (selectedElements[0] == null) { return; } - var len = selectedElements.length; - for (var i = 0; i < len; ++i) { - var elem = selectedElements[i]; - if (elem == null) break; - selectorManager.releaseSelector(elem); - selectedElements[i] = null; - selectedBBoxes[i] = null; + if (selectedElements[0] != null) { + var len = selectedElements.length; + for (var i = 0; i < len; ++i) { + var elem = selectedElements[i]; + if (elem == null) break; + selectorManager.releaseSelector(elem); + selectedElements[i] = null; + selectedBBoxes[i] = null; + } } call("selected", selectedElements); }; @@ -3492,7 +3493,8 @@ function BatchCommand(text) { batchCmd.addSubCommand(new RemoveElementCommand(elem, parent)); } if (!batchCmd.isEmpty()) addCommandToHistory(batchCmd); - call("selected", selectedCopy); + call("changed", selectedCopy); + canvas.clearSelection(); }; this.groupSelectedElements = function() {