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
master
Jeff Schiller 2009-09-22 18:29:15 +00:00
parent 7a4d09d6dd
commit 91a348412e
1 changed files with 11 additions and 9 deletions

View File

@ -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() {