Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
update EffectsCallback signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Jun 26, 2014
1 parent d128070 commit 3c6fa91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions core-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@
behaves essentially the same as `requestAnimationFrame`:
var animation = new CoreAnimation();
animation.
animation.customEffect = function(timeFraction, target, animation) {
// do something custom
};
animation.play();
Elements that are targets to a `core-animation` are given the `core-animation-target` class.
Expand Down Expand Up @@ -101,10 +104,11 @@
keyframes: {value: null, reflect: true},

/**
* A custom animation function. Either provide this or `keyframes`.
* A custom animation function. Either provide this or `keyframes`. The signature
* of the callback is EffectsCallback(timeFraction, target, animation)
*
* @property customEffect
* @type Function
* @type Function(number, Object, Object)
*/
customEffect: {value: null, reflect: true},

Expand Down
6 changes: 3 additions & 3 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@
<polymer-fadein>fade in</polymer-fadein>
--> </div>
<script>
var customAnimationFn = function(timeFraction, animation, previousTimeFraction) {
var customAnimationFn = function(timeFraction, target) {
if (timeFraction < 1) {
animation.target.textContent = timeFraction;
target.textContent = timeFraction;
} else {
animation.target.textContent = 'animated!';
target.textContent = 'animated!';
}
};

Expand Down

0 comments on commit 3c6fa91

Please sign in to comment.