From 5094a7339b3a40d0bf130d9e502e54b00948aa64 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Tue, 16 Feb 2010 11:17:45 -0600 Subject: [PATCH] Make SVG-Edit Clone-Element Work with foreignObject Fixes SVG-Edit Issue #485. --- public/svg-edit/editor/svgcanvas.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/svg-edit/editor/svgcanvas.js b/public/svg-edit/editor/svgcanvas.js index b67c3fbe..316057c4 100644 --- a/public/svg-edit/editor/svgcanvas.js +++ b/public/svg-edit/editor/svgcanvas.js @@ -7593,11 +7593,9 @@ function BatchCommand(text) { // we also do it manually because Opera/Win/non-EN puts , instead of . var copyElem = function(el) { // manually create a copy of the element - var new_el = document.createElementNS(svgns, el.nodeName); + var new_el = document.createElementNS(el.namespaceURI, el.nodeName); $.each(el.attributes, function(i, attr) { - var ns = attr.localName == 'href' ? xlinkns : - attr.prefix == "xml" ? xmlns : null; - new_el.setAttributeNS(ns, attr.nodeName, attr.nodeValue); + new_el.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.nodeValue); }); // set the copied element's new id new_el.removeAttribute("id");