react-faux-dom
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -0,1 +1,5 @@ | ||
# 2.0.1 | ||
* Fix [#10] (vendor prefixed styles not being camel-cased correctly) | ||
# 2.0.0 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "react-faux-dom", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "DOM like data structure to be mutated by D3 et al, then rendered to React elements", | ||
@@ -5,0 +5,0 @@ "main": "src/ReactFauxDOM.js", |
@@ -9,2 +9,12 @@ var React = require('react') | ||
function styleCamelCase (name) { | ||
var camel = camelCase(name) | ||
if (name[0] === '-') { | ||
return camel[0].toUpperCase() + camel.slice(1) | ||
} else { | ||
return camel | ||
} | ||
} | ||
function Element (nodeName, parentNode) { | ||
@@ -19,9 +29,9 @@ this.nodeName = nodeName | ||
setProperty: function (name, value) { | ||
props.style[camelCase(name)] = value | ||
props.style[styleCamelCase(name)] = value | ||
}, | ||
getProperty: function (name) { | ||
return props.style[camelCase(name)] | ||
return props.style[styleCamelCase(name)] | ||
}, | ||
removeProperty: function (name) { | ||
delete props.style[camelCase(name)] | ||
delete props.style[styleCamelCase(name)] | ||
} | ||
@@ -28,0 +38,0 @@ } |
@@ -49,1 +49,8 @@ var test = require('tape') | ||
}) | ||
test('vendor prefixed styles are correctly camel-cased', function (t) { | ||
var el = mk().node() | ||
el.setAttribute('style', '-webkit-transition: opacity 100ms ease') | ||
t.plan(1) | ||
t.equal(el.style.WebkitTransition, 'opacity 100ms ease') | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24639
588