From 10519d9a0ca12c6978b4017a682b8b8b8938f415 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Wed, 15 Dec 2010 19:42:48 +0000 Subject: [PATCH] Fixed bug where empty anchor elements would appear after deleting links git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1884 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 3b3436d9..1e480464 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -8876,8 +8876,16 @@ this.deleteSelectedElements = function() { var parent = selected.parentNode; var t = selected; + // this will unselect the element and remove the selectedOutline selectorManager.releaseSelector(t); + + // Get the parent if it's a single-child anchor + if(parent.tagName === 'a' && parent.childNodes.length === 1) { + t = parent; + parent = parent.parentNode; + } + var nextSibling = t.nextSibling; var elem = parent.removeChild(t); selectedCopy.push(selected); //for the copy