Make SVG-Edit Clone-Element Work with foreignObject
Fixes SVG-Edit Issue #485.
This commit is contained in:
parent
d6e749cf6a
commit
5094a7339b
|
@ -7593,11 +7593,9 @@ function BatchCommand(text) {
|
||||||
// we also do it manually because Opera/Win/non-EN puts , instead of .
|
// we also do it manually because Opera/Win/non-EN puts , instead of .
|
||||||
var copyElem = function(el) {
|
var copyElem = function(el) {
|
||||||
// manually create a copy of the element
|
// 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) {
|
$.each(el.attributes, function(i, attr) {
|
||||||
var ns = attr.localName == 'href' ? xlinkns :
|
new_el.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.nodeValue);
|
||||||
attr.prefix == "xml" ? xmlns : null;
|
|
||||||
new_el.setAttributeNS(ns, attr.nodeName, attr.nodeValue);
|
|
||||||
});
|
});
|
||||||
// set the copied element's new id
|
// set the copied element's new id
|
||||||
new_el.removeAttribute("id");
|
new_el.removeAttribute("id");
|
||||||
|
|
Loading…
Reference in a new issue