Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: third_party/polymer/components-chromium/core-transition/core-transition-extracted.js

Issue 592593002: Inline scripts were extracted from Polymer elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/echo ""/echo/ Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ }
+
+ });
+

Powered by Google App Engine
This is Rietveld 408576698