Index: third_party/polymer/components-chromium/core-transition/core-transition-extracted.js |
diff --git a/third_party/polymer/components-chromium/core-transition/core-transition-extracted.js b/third_party/polymer/components-chromium/core-transition/core-transition-extracted.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e509dd2b21968ad3584656b5527c771e6577b6be |
--- /dev/null |
+++ b/third_party/polymer/components-chromium/core-transition/core-transition-extracted.js |
@@ -0,0 +1,66 @@ |
+ |
+ Polymer('core-transition', { |
+ |
+ type: 'transition', |
+ |
+ /** |
+ * Run the animation. |
+ * |
+ * @method go |
+ * @param {Node} node The node to apply the animation on |
+ * @param {Object} state State info |
+ */ |
+ go: function(node, state) { |
+ this.complete(node); |
+ }, |
+ |
+ /** |
+ * Set up the animation. This may include injecting a stylesheet, |
+ * applying styles, creating a web animations object, etc.. This |
+ * |
+ * @method setup |
+ * @param {Node} node The animated node |
+ */ |
+ setup: function(node) { |
+ }, |
+ |
+ /** |
+ * Tear down the animation. |
+ * |
+ * @method teardown |
+ * @param {Node} node The animated node |
+ */ |
+ teardown: function(node) { |
+ }, |
+ |
+ /** |
+ * Called when the animation completes. This function also fires the |
+ * `core-transitionend` event. |
+ * |
+ * @method complete |
+ * @param {Node} node The animated node |
+ */ |
+ complete: function(node) { |
+ this.fire('core-transitionend', null, node); |
+ }, |
+ |
+ /** |
+ * Utility function to listen to an event on a node once. |
+ * |
+ * @method listenOnce |
+ * @param {Node} node The animated node |
+ * @param {string} event Name of an event |
+ * @param {Function} fn Event handler |
+ * @param {Array} args Additional arguments to pass to `fn` |
+ */ |
+ listenOnce: function(node, event, fn, args) { |
+ var self = this; |
+ var listener = function() { |
+ fn.apply(self, args); |
+ node.removeEventListener(event, listener, false); |
+ } |
+ node.addEventListener(event, listener, false); |
+ } |
+ |
+ }); |
+ |