Skip to content

Commit

Permalink
Don't consider properties transform properties if object doesn't have…
Browse files Browse the repository at this point in the history
… a style property
  • Loading branch information
michaelvillar committed Dec 9, 2015
1 parent b2c0397 commit 5cb5a39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/dynamics.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ startAnimation = (el, properties, options, timeoutId) ->
endProperties = {}
transforms = []
for k, v of properties
if transformProperties.contains(k)
if el.style? and transformProperties.contains(k)
transforms.push([k, v])
else
endProperties[k] = createInterpolable(v)
Expand Down
10 changes: 7 additions & 3 deletions test/dynamics.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ describe 'dynamics.animate', ->
done()
, 150

it 'animates properties of a object correctly', (done) ->
it 'animates properties of an object correctly', (done) ->
assertTypes = (object) ->
expect(typeof(object.number)).to.be.equal('number', 'object.number has the wrong type')
expect(typeof(object.negative)).to.be.equal('number', 'object.negative has the wrong type')
Expand Down Expand Up @@ -234,7 +234,9 @@ describe 'dynamics.animate', ->
array: ["0deg", 0, "1.10", 10, "#FFFFFF"],
hexColor: "#FFFFFF",
rgbColor: "rgb(255, 255, 255)",
rgbaColor: "rgba(255, 255, 255, 0)"
rgbaColor: "rgba(255, 255, 255, 0)",
translateX: 0,
rotateZ: 0
}
previous = JSON.parse(JSON.stringify(object))
dynamics.animate(object, {
Expand All @@ -245,7 +247,9 @@ describe 'dynamics.animate', ->
array: ["100deg", 40, "2.20", 20, "#123456"],
hexColor: "#123456",
rgbColor: "rgb(18, 52, 86)",
rgbaColor: "rgba(18, 52, 86, 1)"
rgbaColor: "rgba(18, 52, 86, 1)",
translateX: 10,
rotateZ: 1
}, {
duration: 100
})
Expand Down

0 comments on commit 5cb5a39

Please sign in to comment.