Move mjx-svg-href class to <a> rather than its child. Resolves issue #427.

This commit is contained in:
Davide P. Cervone 2013-04-19 08:08:59 -04:00
parent 486cd40424
commit 9e65b9ce74

View File

@ -1018,7 +1018,7 @@
// FIXME: if an element has an id, its zoomed copy will have the same ID
if (this.id) {svg.removeable = false; SVG.Element(svg.element,{"id":this.id})}
if (this.href) {
var a = SVG.Element("a");
var a = SVG.Element("a",{"class":"mjx-svg-href"});
a.setAttributeNS(XLINKNS,"href",this.href);
a.onclick = this.SVGlink;
SVG.addElement(a,"rect",{width:svg.w, height:svg.h+svg.d, y:-svg.d,
@ -1027,10 +1027,8 @@
// for svg element, put <a> inside the main <g> element
var g = svg.element.firstChild;
while (g.firstChild) {a.appendChild(g.firstChild)}
g.appendChild(a); this.SVGaddClass(g,"mjx-svg-href");
g.removeAttribute("fill"); g.removeAttribute("stroke");
g.appendChild(a);
} else {
this.SVGaddClass(svg.element,"mjx-svg-href");
a.appendChild(svg.element); svg.element = a;
}
svg.removeable = false;