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

Commit

Permalink
polymer-ui-animated-pages: add polymer-pages-animation-end event
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvonne Yip committed Oct 15, 2013
1 parent 760c71f commit a2263a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion polymer-ui-animated-pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<input value="{{duration}}" size="4">
</label>
</polymer-ui-toolbar>
<polymer-ui-animated-pages selected="{{page}}" directional?="{{directional}}" transition="{{transition}}">
<polymer-ui-animated-pages selected="{{page}}" directional?="{{directional}}" transition="{{transition}}" on-polymer-pages-animation-end="animationEndAction">
<div class="grid" value="one">One</div>
<div class="brick" value="two">Two</div>
<div class="wave">Three</div>
Expand Down Expand Up @@ -230,6 +230,9 @@
if (this.page > 4) {
this.page = this.directional ? this.page - 1 : 0;
}
},
animationEndAction: function() {
console.log('animationEnd');
}
});
</script>
Expand Down
9 changes: 9 additions & 0 deletions polymer-ui-animated-pages/polymer-ui-animated-pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
* @extends polymer-selector
*/
-->
<!--
/**
* Fired when the transition animation ends
* @event polymer-pages-animation-end
-->

<link rel="import" href="../../polymer-elements/polymer-animation/web-animations.html">
<link rel="import" href="../polymer-ui-pages/polymer-ui-pages.html">
Expand Down Expand Up @@ -112,6 +117,7 @@
fill: 'none',
direction: direction
});
animation.onend = this.animationEndAction.bind(this);
return animation;
},
selectedItemChanged: function(oldItem) {
Expand All @@ -120,6 +126,9 @@
if (this.hasTransition()) {
this.applyTransition();
}
},
animationEndAction: function() {
this.fire('polymer-pages-animation-end');
}
})
</script>
Expand Down

0 comments on commit a2263a9

Please sign in to comment.