Issue 118: Fixed problem when selectorParentGroup hangs around after clearing the document

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@730 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-09-29 17:01:28 +00:00
parent 451a5f518b
commit c588d0d74d
1 changed files with 8 additions and 4 deletions

View File

@ -444,10 +444,14 @@ function BatchCommand(text) {
var mgr = this;
this.initGroup = function() {
mgr.selectorParentGroup = addSvgElementFromJson({
"element": "g",
"attr": {"id": "selectorParentGroup"}
});
// remove old selector parent group if it existed
if (mgr.selectorParentGroup && mgr.selectorParentGroup.parentNode) {
mgr.selectorParentGroup.parentNode.removeChild(mgr.selectorParentGroup);
}
// create parent selector group and add it to svgroot
mgr.selectorParentGroup = svgdoc.createElementNS(svgns, "g");
mgr.selectorParentGroup.setAttribute("id", "selectorParentGroup");
svgroot.appendChild(mgr.selectorParentGroup);
mgr.selectorMap = {};
mgr.selectors = [];
mgr.rubberBandBox = null;