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

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

Issue 596633002: Do not change state of More/less settings button until printer capabilities are retrieved to avoid … (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 | « no previous file | 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/more_settings.js
diff --git a/chrome/browser/resources/print_preview/settings/more_settings.js b/chrome/browser/resources/print_preview/settings/more_settings.js
index 55e23c041c96dd972b724f309ba0aa739c2f2814..7f924eeb2b0811aad675ec70c00176f51151a46d 100644
--- a/chrome/browser/resources/print_preview/settings/more_settings.js
+++ b/chrome/browser/resources/print_preview/settings/more_settings.js
@@ -112,6 +112,10 @@ cr.define('print_preview', function() {
fadeOutElement(this.getElement(), noAnimation);
return;
}
+ // When capabilities are not known yet, don't change the state to avoid
+ // unnecessary fade in/out cycles.
+ if (!this.capabilitiesReady_)
+ return;
var all = this.settingsToShow_ == MoreSettings.SettingsToShow.ALL;
this.getChildElement('.more-settings-label').textContent =
@@ -126,10 +130,9 @@ cr.define('print_preview', function() {
}, 0);
// Magic 6 is chosen as the number of sections when it still feels like
- // manageable and not too crowded. Also, when capabilities are not know
- // yet, ignore this limit to avoid unnecessary fade in/out cycles.
+ // manageable and not too crowded.
var hasSectionsToToggle =
- (availableSections > 6 || !this.capabilitiesReady_) &&
+ availableSections > 6 &&
this.settingsSections_.some(function(section) {
return section.hasCollapsibleContent();
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698