Chromium Code Reviews| 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 b5b233bf4eb8e7271272cc94fc90babbea055233..d9050f30651fba609bdb55e3a5ec112f3cbf2d10 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,16 +400,7 @@ |
| }, |
| get target () { |
| - 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; |
| + return this.keyEventTarget; |
| }, |
| keyBindings: { |
| @@ -422,14 +413,19 @@ |
| // 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. |
| - this.keyEventTarget = this.target; |
| - this.listen(this.target, 'up', 'uiUpAction'); |
| - this.listen(this.target, 'down', 'uiDownAction'); |
| + if (this.parentNode.nodeType == 11) { // DOCUMENT_FRAGMENT_NODE |
| + this.keyEventTarget = Polymer.dom(this).getOwnerRoot().host; |
| + } else { |
| + this.keyEventTarget = this.parentNode; |
| + } |
| + this.listen(this.keyEventTarget, 'up', 'uiUpAction'); |
|
Dan Beam
2016/06/21 01:44:55
this breaks closure:
https://build.chromium.org/p/
|
| + this.listen(this.keyEventTarget, 'down', 'uiDownAction'); |
| }, |
| detached: function() { |
| - this.unlisten(this.target, 'up', 'uiUpAction'); |
| - this.unlisten(this.target, 'down', 'uiDownAction'); |
| + this.unlisten(this.keyEventTarget, 'up', 'uiUpAction'); |
| + this.unlisten(this.keyEventTarget, 'down', 'uiDownAction'); |
| + this.keyEventTarget = null; |
| }, |
| get shouldKeepAnimating () { |
| @@ -477,6 +473,7 @@ |
| ripple.downAction(event); |
| if (!this._animating) { |
| + this._animating = true; |
| this.animate(); |
| } |
| }, |
| @@ -506,6 +503,7 @@ |
| ripple.upAction(event); |
| }); |
| + this._animating = true; |
| this.animate(); |
| }, |
| @@ -544,11 +542,12 @@ |
| }, |
| 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,5 +592,14 @@ |
| 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. |
| + */ |
| }); |
| })(); |