2 Polymer('core-transition', {
10 * @param {Node} node The node to apply the animation on
11 * @param {Object} state State info
13 go: function(node, state) {
18 * Set up the animation. This may include injecting a stylesheet,
19 * applying styles, creating a web animations object, etc.. This
22 * @param {Node} node The animated node
24 setup: function(node) {
28 * Tear down the animation.
31 * @param {Node} node The animated node
33 teardown: function(node) {
37 * Called when the animation completes. This function also fires the
38 * `core-transitionend` event.
41 * @param {Node} node The animated node
43 complete: function(node) {
44 this.fire('core-transitionend', null, node);
48 * Utility function to listen to an event on a node once.
51 * @param {Node} node The animated node
52 * @param {string} event Name of an event
53 * @param {Function} fn Event handler
54 * @param {Array} args Additional arguments to pass to `fn`
56 listenOnce: function(node, event, fn, args) {
58 var listener = function() {
60 node.removeEventListener(event, listener, false);
62 node.addEventListener(event, listener, false);