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

Unified Diff: chrome/browser/resources/settings/settings_page/settings_section.js

Issue 2224673002: MD Settings: simplify animation scheduling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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: chrome/browser/resources/settings/settings_page/settings_section.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_section.js b/chrome/browser/resources/settings/settings_page/settings_section.js
index de1e420e77a046ad26ba4023bdd39dd556ff6d1e..5f775d0a52a96f9367b9d09eebfc57defe1088c1 100644
--- a/chrome/browser/resources/settings/settings_page/settings_section.js
+++ b/chrome/browser/resources/settings/settings_page/settings_section.js
@@ -95,7 +95,7 @@ var SettingsSectionElement = Polymer({
* class while the animation plays.
*
* @param {!HTMLElement} container The scrolling container to fill.
- * @return {?SettingsSectionElement.AnimationConfig}
+ * @return {?settings.animation.Animation} Animation played, if any.
*/
animateExpand: function(container) {
var card = this.$.card;
@@ -126,7 +126,7 @@ var SettingsSectionElement = Polymer({
duration: EXPAND_DURATION
});
// TODO(michaelpg): Change elevation of sections.
- return {card: card, keyframes: keyframes, options: options};
+ return new settings.animation.Animation(card, keyframes, options);
},
/**
@@ -157,7 +157,7 @@ var SettingsSectionElement = Polymer({
* @param {!HTMLElement} container The scrolling container the card fills.
* @param {number} prevScrollTop scrollTop of the container before this
* section expanded.
- * @return {?SettingsSectionElement.AnimationConfig}
+ * @return {?settings.animation.Animation} Animation played, if any.
*/
animateCollapse: function(container, prevScrollTop) {
this.$.header.hidden = false;
@@ -209,7 +209,7 @@ var SettingsSectionElement = Polymer({
card.style.width = cardWidthStart + 'px';
- return {card: card, keyframes: keyframes, options: options};
+ return new settings.animation.Animation(card, keyframes, options);
},
/**
@@ -221,13 +221,3 @@ var SettingsSectionElement = Polymer({
this.$.card.style.width = '';
},
});
-
-/**
- * Information needed by TransitionBehavior to schedule animations.
- * @typedef {{
- * card: !HTMLElement,
- * keyframes: !Array<!Object>,
- * options: !KeyframeEffectOptions
- * }}
- */
-SettingsSectionElement.AnimationConfig;

Powered by Google App Engine
This is Rietveld 408576698