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

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

Issue 2769593002: MD Settings/Downloads: show file chooser after CHANGE button ripple completes (Closed)
Patch Set: test fix Created 3 years, 9 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
« no previous file with comments | « chrome/test/data/webui/settings/downloads_page_test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d57ca91698fe86c428e9456450bcb2b4d236de1c..931d32098eaf19fc44230a0e06847300d0b8efc3 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
@@ -156,24 +156,27 @@ Polymer({
* @suppress {checkTypes}
*/
__hideRipple: function() {
- this.ripples.forEach(function(ripple) {
- var removeRipple = function() { ripple.remove(); };
- // TODO(dbeam): should we be firing a transitionend event here? Does
- // anybody actually use it? It's in the original paper-ripple.
- var opacity = getComputedStyle(ripple).opacity;
- if (!opacity.length) {
- removeRipple();
- } else {
- var animation = ripple.animate({
- opacity: [opacity, 0],
- }, {
- duration: 150,
- fill: 'forwards',
- });
- animation.addEventListener('finish', removeRipple);
- animation.addEventListener('cancel', removeRipple);
- }
- });
+ Promise.all(this.ripples.map(function(ripple) {
+ return new Promise(function(resolve) {
+ var removeRipple = function() {
+ ripple.remove();
+ resolve();
+ };
+ var opacity = getComputedStyle(ripple).opacity;
+ if (!opacity.length) {
+ removeRipple();
+ } else {
+ var animation = ripple.animate({
+ opacity: [opacity, 0],
+ }, {
+ duration: 150,
+ fill: 'forwards',
+ });
+ animation.addEventListener('finish', removeRipple);
+ animation.addEventListener('cancel', removeRipple);
+ }
+ });
+ })).then(function() { this.fire('transitionend'); }.bind(this));
this.ripples = [];
},
« no previous file with comments | « chrome/test/data/webui/settings/downloads_page_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698