Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix start and end values of element properties animation #31

Merged
merged 1 commit into from Aug 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/dynamics.coffee
Expand Up @@ -172,7 +172,11 @@ getCurrentProperties = (el, keys) ->
matrix = Matrix.fromTransform(style[propertyWithPrefix('transform')])
properties['transform'] = matrix.decompose()
else
v = style[key]
if key of el # support animating scrollTop, etc
v = el[key]
else
v = style[key]

if (!v? or key is 'd') && svgProperties.contains(key)
v = el.getAttribute(key)
if v == "" or !v?
Expand Down Expand Up @@ -1130,7 +1134,7 @@ startAnimation = (el, properties, options, timeoutId) ->
transforms.push([k, v])
else
interpolable = createInterpolable(v)
if interpolable instanceof InterpolableNumber && el.style?
if interpolable instanceof InterpolableNumber && k not of el && el.style?
interpolable = new InterpolableString([
interpolable,
unitForProperty(k, 0),
Expand Down