Unhyphenate CSS property names when rendering to the DOM

Annoyingly, Chrome will happily accept `background-color` and
`backgroundColor` interchangeably, so I hadn't noticed that this was
broken...
This commit is contained in:
Jeremy Ruston
2012-06-11 10:41:13 +01:00
parent 85d7bb6d8b
commit d0a9bfd0f0
3 changed files with 15 additions and 1 deletions

View File

@@ -96,7 +96,7 @@ Element.prototype.renderInDom = function(parentDomNode,insertBefore) {
element.className = v.join(" ");
} else if (typeof v === "object") { // ...or objects other than style?
for(var p in v) {
element.style[p] = v[p];
element.style[$tw.utils.unHyphenateCss(p)] = v[p];
}
} else {
element.setAttribute(a,v);