From 28d1dbcfe52e2cdef91dbd4521832161a738f594 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Wed, 2 Feb 2011 19:36:49 +0000 Subject: [PATCH] Fixed other part of issue 662: Break link to reference element Undo weirdness git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1970 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index d227b8e0..f89f285e 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -528,6 +528,14 @@ var restoreRefElems = function(elem) { } } } + + var childs = elem.getElementsByTagName('*'); + + if(childs.length) { + for(var i = 0, l = childs.length; i < l; i++) { + restoreRefElems(childs[i]); + } + } }; (function() { @@ -6466,6 +6474,7 @@ var setUseData = this.setUseData = function(parent) { elems.each(function() { var id = getHref(this).substr(1); var ref_elem = getElem(id); + if(!ref_elem) return; $(this).data('ref', ref_elem); if(ref_elem.tagName == 'symbol' || ref_elem.tagName == 'svg') { $(this).data('symbol', ref_elem);