From 0c0a935a57cd7d519f168c9456c17d3f1965c35a Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Wed, 20 Jan 2010 22:36:59 +0000 Subject: [PATCH] Make copy/clone work on elements git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1255 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 1abcd7d2..9afc9071 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1,4 +1,10 @@ /* +USE TODO: + - scrub xlink:href to ensure a local reference only + - debug why sometimes the disappears from the canvas + +*/ +/* * svgcanvas.js * * Licensed under the Apache License, Version 2 @@ -6876,7 +6882,7 @@ function BatchCommand(text) { // manually create a copy of the element var new_el = document.createElementNS(svgns, el.nodeName); $.each(el.attributes, function(i, attr) { - var ns = attr.nodeName == 'href' ? xlinkns : + var ns = attr.localName == 'href' ? xlinkns : attr.prefix == "xml" ? xmlns : null; new_el.setAttributeNS(ns, attr.nodeName, attr.nodeValue); });