Skip to content

Commit

Permalink
The criterium for using setAttribute on class was updated to only…
Browse files Browse the repository at this point in the history
… apply to `SVGElement` instances. #2048
  • Loading branch information
Alfredo-Delgado committed Oct 31, 2015
1 parent ea6270b commit 385a2a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions util/attr/attr.js
Expand Up @@ -40,12 +40,13 @@ steal("can/util/can.js", function (can) {
map: {
"class": function(el, val) {
val = val || '';
el.className = val;

if(el.className !== val) {
// e.g. svg elements #2015
if(el instanceof SVGElement) {
el.setAttribute('class', val);
}
else {
el.className = val;
}

return val;
},
Expand Down

0 comments on commit 385a2a7

Please sign in to comment.