Commit 1789d42d authored by alekseys's avatar alekseys Committed by Commit bot

Do not change state of More/less settings button until printer capabilities...

Do not change state of More/less settings button until printer capabilities are retrieved to avoid unnecessary fade in/out cycles.

BUG=415898

Review URL: https://codereview.chromium.org/596633002

Cr-Commit-Position: refs/heads/master@{#296123}
parent 88ca4119
......@@ -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();
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment