MCPcopy
hub / github.com/methodofaction/Method-Draw / setAttrs

Function setAttrs

src/js/lib/jquery.jgraduate.js:136–149  ·  view source on GitHub ↗
(elem, attrs)

Source from the content-addressed store, hash-verified

134var isGecko = navigator.userAgent.indexOf('Gecko/') >= 0;
135
136function setAttrs(elem, attrs) {
137 if(isGecko) {
138 for (var aname in attrs) elem.setAttribute(aname, attrs[aname]);
139 } else {
140 for (var aname in attrs) {
141 var val = attrs[aname], prop = elem[aname];
142 if(prop && prop.constructor === 'SVGLength') {
143 prop.baseVal.value = val;
144 } else {
145 elem.setAttribute(aname, val);
146 }
147 }
148 }
149}
150
151function mkElem(name, attrs, newparent) {
152 var elem = document.createElementNS(ns.svg, name);

Callers 1

mkElemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected