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

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

Issue 565213005: Make Print Preview elements transitions smoother. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chrome/browser/resources/print_preview/settings/page_settings.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/settings/settings_section.js
diff --git a/chrome/browser/resources/print_preview/settings/settings_section.js b/chrome/browser/resources/print_preview/settings/settings_section.js
index d36178eec9d689357fa47c90935ad22cbf5a9943..dffa7db563c6d49d7cd36a3b4dd056ada846e1a5 100644
--- a/chrome/browser/resources/print_preview/settings/settings_section.js
+++ b/chrome/browser/resources/print_preview/settings/settings_section.js
@@ -24,7 +24,7 @@ cr.define('print_preview', function() {
* Whether content of this section should be collapsed or not.
* @private {boolean}
*/
- this.collapseContent_ = false;
+ this.collapseContent_ = true;
};
/**
@@ -68,10 +68,12 @@ cr.define('print_preview', function() {
/**
* @param {boolean} collapseContent Whether the content of this section
* should be collapsed, even if this section is available.
+ * @param {boolean} noAnimation Whether section visibility transition
+ * should not be animated.
*/
- set collapseContent(collapseContent) {
+ setCollapseContent: function(collapseContent, noAnimation) {
this.collapseContent_ = collapseContent && this.hasCollapsibleContent();
- this.updateUiStateInternal();
+ this.updateUiStateInternal(noAnimation);
},
/** @override */
@@ -84,17 +86,19 @@ cr.define('print_preview', function() {
/**
* Updates the component appearance according to the current state.
+ * @param {boolean=} opt_noAnimation Whether section visibility transition
+ * should not be animated.
* @protected
*/
- updateUiStateInternal: function() {
+ updateUiStateInternal: function(opt_noAnimation) {
var hasCollapsibleContent = this.hasCollapsibleContent();
var changed = this.hasCollapsibleContentCached_ != hasCollapsibleContent;
this.hasCollapsibleContentCached_ = hasCollapsibleContent;
if (this.isSectionVisibleInternal())
- fadeInOption(this.getElement());
+ fadeInOption(this.getElement(), opt_noAnimation);
else
- fadeOutOption(this.getElement());
+ fadeOutOption(this.getElement(), opt_noAnimation);
if (changed) {
cr.dispatchSimpleEvent(
« no previous file with comments | « chrome/browser/resources/print_preview/settings/page_settings.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698