commit ce8c8882ea26004e968b072df40bcef8c54d09e7
parent 796c6b484deefa7b63ba0913eaa5a8f7db1ff086
Author: Davide P. Cervone <dpvc@union.edu>
Date: Fri, 19 Apr 2013 09:31:42 -0400
Merge branch 'issue427' into develop
Resolves issue #427.
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js
@@ -60,7 +60,7 @@
width: "100%"
},
- ".MathJax_SVG svg a > g, .MathJax_SVG_Display svg a > g": {
+ ".mjx-svg-href": {
fill: "blue", stroke: "blue"
},
@@ -1022,7 +1022,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,
@@ -1033,17 +1033,13 @@
while (g.firstChild) {a.appendChild(g.firstChild)}
g.appendChild(a);
} else {
- // if removeable, move contents of <g> to <a>, otherise move element to <a>
- if (svg.removeable && svg.element.nodeName === "g") {
- while (svg.element.firstChild) {a.appendChild(svg.element.firstChild)}
- } else {a.appendChild(svg.element)}
- svg.element = a;
+ a.appendChild(svg.element); svg.element = a;
}
svg.removeable = false;
}
if (SVG.config.addMMLclasses) {
+ this.SVGaddClass(svg.element,"mjx-svg-"+this.type);
svg.removeable = false;
- svg.element.setAttribute("className","mjx-svg-"+this.type);
}
var style = this.style;
if (style && svg.element) {
@@ -1053,6 +1049,10 @@
if (svg.removeable) {svg.removeable = svg.element.style.cssText === ""}
}
},
+ SVGaddClass: function (node,name) {
+ var classes = node.getAttribute("class");
+ node.setAttribute("class",(classes ? classes+" " : "")+name);
+ },
//
// WebKit currently scrolls to the BOTTOM of an svg element if it contains the
// target of the link, so implement link by hand, to the containing span element.