mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
use class attribute in applyElementScopeSelector
className can be a special object in IE Fixes #3285
This commit is contained in:
parent
9cd6b796a1
commit
07d8c0622e
@ -283,14 +283,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
applyElementScopeSelector: function(element, selector, old, viaAttr) {
|
||||
var c = viaAttr ? element.getAttribute(styleTransformer.SCOPE_NAME) :
|
||||
element.className;
|
||||
(element.getAttribute('class') || '');
|
||||
var v = old ? c.replace(old, selector) :
|
||||
(c ? c + ' ' : '') + this.XSCOPE_NAME + ' ' + selector;
|
||||
if (c !== v) {
|
||||
if (viaAttr) {
|
||||
element.setAttribute(styleTransformer.SCOPE_NAME, v);
|
||||
} else {
|
||||
element.className = v;
|
||||
element.setAttribute('class', v);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user