ApplicationImpl cleanup, part 1:
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / neon-animation / neon-animation-behavior-extracted.js
blob8b8f9dc92a5a8ad1688c1a22ab7811359c2f568e
3 /**
4 * Use `Polymer.NeonAnimationBehavior` to implement an animation.
5 * @polymerBehavior
6 */
7 Polymer.NeonAnimationBehavior = {
9 properties: {
11 /**
12 * Defines the animation timing.
14 animationTiming: {
15 type: Object,
16 value: function() {
17 return {
18 duration: 500,
19 easing: 'cubic-bezier(0.4, 0, 0.2, 1)',
20 fill: 'both'
27 registered: function() {
28 new Polymer.IronMeta({type: 'animation', key: this.is, value: this.constructor});
31 /**
32 * Do any animation configuration here.
34 // configure: function(config) {
35 // },
37 /**
38 * Returns the animation timing by mixing in properties from `config` to the defaults defined
39 * by the animation.
41 timingFromConfig: function(config) {
42 if (config.timing) {
43 for (var property in config.timing) {
44 this.animationTiming[property] = config.timing[property];
47 return this.animationTiming;
50 /**
51 * Sets `transform` and `transformOrigin` properties along with the prefixed versions.
53 setPrefixedProperty: function(node, property, value) {
54 var map = {
55 'transform': ['webkitTransform'],
56 'transformOrigin': ['mozTransformOrigin', 'webkitTransformOrigin']
58 var prefixes = map[property];
59 for (var prefix, index = 0; prefix = prefixes[index]; index++) {
60 node.style[prefix] = value;
62 node.style[property] = value;
65 /**
66 * Called when the animation finishes.
68 complete: function() {}