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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js

Issue 2096903002: Revert of [Polymer] update polymer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js
index ee1afff6e965c54f303f9c94e63f7e79bdc90196..b5b233bf4eb8e7271272cc94fc90babbea055233 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js
@@ -400,7 +400,16 @@
},
get target () {
- return this.keyEventTarget;
+ var ownerRoot = Polymer.dom(this).getOwnerRoot();
+ var target;
+
+ if (this.parentNode.nodeType == 11) { // DOCUMENT_FRAGMENT_NODE
+ target = ownerRoot.host;
+ } else {
+ target = this.parentNode;
+ }
+
+ return target;
},
keyBindings: {
@@ -413,20 +422,14 @@
// Set up a11yKeysBehavior to listen to key events on the target,
// so that space and enter activate the ripple even if the target doesn't
// handle key events. The key handlers deal with `noink` themselves.
- if (this.parentNode.nodeType == 11) { // DOCUMENT_FRAGMENT_NODE
- this.keyEventTarget = Polymer.dom(this).getOwnerRoot().host;
- } else {
- this.keyEventTarget = this.parentNode;
- }
- var keyEventTarget = /** @type {!EventTarget} */ (this.keyEventTarget);
- this.listen(keyEventTarget, 'up', 'uiUpAction');
- this.listen(keyEventTarget, 'down', 'uiDownAction');
+ this.keyEventTarget = this.target;
+ this.listen(this.target, 'up', 'uiUpAction');
+ this.listen(this.target, 'down', 'uiDownAction');
},
detached: function() {
- this.unlisten(this.keyEventTarget, 'up', 'uiUpAction');
- this.unlisten(this.keyEventTarget, 'down', 'uiDownAction');
- this.keyEventTarget = null;
+ this.unlisten(this.target, 'up', 'uiUpAction');
+ this.unlisten(this.target, 'down', 'uiDownAction');
},
get shouldKeepAnimating () {
@@ -474,7 +477,6 @@
ripple.downAction(event);
if (!this._animating) {
- this._animating = true;
this.animate();
}
},
@@ -504,7 +506,6 @@
ripple.upAction(event);
});
- this._animating = true;
this.animate();
},
@@ -543,11 +544,10 @@
},
animate: function() {
- if (!this._animating) {
- return;
- }
var index;
var ripple;
+
+ this._animating = true;
for (index = 0; index < this.ripples.length; ++index) {
ripple = this.ripples[index];
@@ -593,14 +593,5 @@
this.upAction();
}
}
-
- /**
- Fired when the animation finishes.
- This is useful if you want to wait until
- the ripple animation finishes to perform some action.
-
- @event transitionend
- @param {{node: Object}} detail Contains the animated node.
- */
});
})();

Powered by Google App Engine
This is Rietveld 408576698