update components

This commit is contained in:
Luke Pulverenti 2016-04-02 12:15:48 -04:00
parent cc555065f7
commit c3fd6c022f
54 changed files with 296 additions and 87 deletions

View file

@ -38,18 +38,6 @@ Configuration:
Polymer.NeonAnimationBehavior
],
properties: {
/** @type {!Polymer.IronMeta} */
_animationMeta: {
type: Object,
value: function() {
return new Polymer.IronMeta({type: 'animation'});
}
}
},
/**
* @param {{
* animation: string,
@ -59,13 +47,6 @@ Configuration:
* }} config
*/
configure: function(config) {
var animationConstructor = /** @type {Function} */ (
this._animationMeta.byKey(config.animation));
if (!animationConstructor) {
console.warn(this.is + ':', 'constructor for', config.animation, 'not found!');
return;
}
this._animations = [];
var nodes = config.nodes;
var effects = [];
@ -75,17 +56,29 @@ Configuration:
config.timing.delay = config.timing.delay || 0;
var oldDelay = config.timing.delay;
var abortedConfigure;
for (var node, index = 0; node = nodes[index]; index++) {
config.timing.delay += nodeDelay;
config.node = node;
var animation = new animationConstructor();
var effect = animation.configure(config);
var animation = document.createElement(config.animation);
if (animation.isNeonAnimation) {
var effect = animation.configure(config);
this._animations.push(animation);
effects.push(effect);
this._animations.push(animation);
effects.push(effect);
} else {
console.warn(this.is + ':', config.animation, 'not found!');
abortedConfigure = true;
break;
}
}
config.timing.delay = oldDelay;
config.node = null;
// if a bad animation was configured, abort config.
if (abortedConfigure) {
return;
}
this._effect = new GroupEffect(effects);
return this._effect;