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

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

Issue 556363003: Print Preview UI tweaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust browser_tests accordingly. 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
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 e66ca57dc09e6fe6858f17c2c3d0058e07dbd20e..2143bbf98bc58d0466be306c28092d33c6c4b065 100644
--- a/chrome/browser/resources/print_preview/settings/more_settings.js
+++ b/chrome/browser/resources/print_preview/settings/more_settings.js
@@ -74,9 +74,18 @@ cr.define('print_preview', function() {
iconEl.classList.toggle('more-settings-icon-plus', !all);
iconEl.classList.toggle('more-settings-icon-minus', all);
- var hasSectionsToToggle = this.settingsSections_.some(function(section) {
- return section.hasCollapsibleContent();
- });
+ var availableSections = this.settingsSections_.reduce(
+ function(count, section) {
+ return count + (section.isAvailable() ? 1 : 0);
+ }, 0);
+
+ // Magic 6 is chosen as the number of sections when it still feels like
+ // manageable and not too crowded.
+ var hasSectionsToToggle =
+ availableSections > 6 &&
+ this.settingsSections_.some(function(section) {
+ return section.hasCollapsibleContent();
+ });
if (hasSectionsToToggle)
fadeInElement(this.getElement());
« no previous file with comments | « chrome/browser/resources/print_preview/settings/more_settings.html ('k') | chrome/test/data/webui/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698