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

Commit

Permalink
polymer-animation: use observe block
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Oct 16, 2013
1 parent e50f049 commit ba27c8d
Showing 1 changed file with 15 additions and 34 deletions.
49 changes: 15 additions & 34 deletions polymer-animation/polymer-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,20 @@
*/
autoplay: false,
animation: false,
created: function() {
observe: {
target: 'asyncApply',
keyframes: 'asyncApply',
sample: 'asyncApply',
composite: 'asyncApply',
duration: 'asyncApply',
fillMode: 'asyncApply',
easing: 'asyncApply',
iterationCount: 'asyncApply',
delay: 'asyncApply',
direction: 'asyncApply',
autoplay: 'asyncApply'
},
ready: function() {
this.asyncApply();
},
/**
Expand All @@ -176,6 +189,7 @@
this.cancelApply();
this.animation = null;
this.animation = this.makeAnimation();
console.log('apply', this.animation);
if (this.autoplay && this.animation) {
this.play();
}
Expand All @@ -202,44 +216,11 @@
// in ShadowDOM the sender becomes the shadow host.
this.fire('animationchange', this);
},
targetChanged: function() {
this.asyncApply();
},
targetSelectorChanged: function() {
if (this.targetSelector) {
this.target = findTarget(this.targetSelector, this);
}
},
keyframesChanged: function() {
this.asyncApply();
},
sampleChanged: function() {
this.asyncApply();
},
compositeChanged: function() {
this.asyncApply();
},
durationChanged: function() {
this.asyncApply();
},
fillModeChanged: function() {
this.asyncApply();
},
easingChanged: function() {
this.asyncApply();
},
iterationCountChanged: function() {
this.asyncApply();
},
delayChanged: function() {
this.asyncApply();
},
directionChanged: function() {
this.asyncApply();
},
autoplayChanged: function() {
this.asyncApply();
},
get timingProps() {
var props = {};
var timing = {
Expand Down

0 comments on commit ba27c8d

Please sign in to comment.