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

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

Issue 477133004: Printe Preview: add 'More/less options' button and make non-essential sections collapsible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Print Preview UI tests adjusted. Created 6 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/print_preview/settings/layout_settings.js
diff --git a/chrome/browser/resources/print_preview/settings/layout_settings.js b/chrome/browser/resources/print_preview/settings/layout_settings.js
index f1a25d6056bf03cc986de64f34de2d3d3f23a50a..057f48a44c01badd0fe5203a79d7991d7d5e6a44 100644
--- a/chrome/browser/resources/print_preview/settings/layout_settings.js
+++ b/chrome/browser/resources/print_preview/settings/layout_settings.js
@@ -11,10 +11,10 @@ cr.define('print_preview', function() {
* @param {!print_preview.ticket_items.Landscape} landscapeTicketItem Used to
* get the layout written to the print ticket.
* @constructor
- * @extends {print_preview.Component}
+ * @extends {print_preview.SettingsSection}
*/
function LayoutSettings(landscapeTicketItem) {
- print_preview.Component.call(this);
+ print_preview.SettingsSection.call(this);
/**
* Used to get the layout written to the print ticket.
@@ -35,9 +35,19 @@ cr.define('print_preview', function() {
};
LayoutSettings.prototype = {
- __proto__: print_preview.Component.prototype,
+ __proto__: print_preview.SettingsSection.prototype,
- /** @param {boolean} isEnabled Whether this component is enabled. */
+ /** @override */
+ isAvailable: function() {
+ return this.landscapeTicketItem_.isCapabilityAvailable();
+ },
+
+ /** @override */
+ hasCollapsibleContent: function() {
+ return false;
+ },
+
+ /** @override */
set isEnabled(isEnabled) {
this.landscapeRadioButton_.disabled = !isEnabled;
this.portraitRadioButton_.disabled = !isEnabled;
@@ -45,8 +55,7 @@ cr.define('print_preview', function() {
/** @override */
enterDocument: function() {
- print_preview.Component.prototype.enterDocument.call(this);
- fadeOutOption(this.getElement(), true);
+ print_preview.SettingsSection.prototype.enterDocument.call(this);
this.tracker.add(
this.portraitRadioButton_,
'click',
@@ -94,14 +103,12 @@ cr.define('print_preview', function() {
* @private
*/
onLandscapeTicketItemChange_: function() {
- if (this.landscapeTicketItem_.isCapabilityAvailable()) {
+ if (this.isAvailable()) {
var isLandscapeEnabled = this.landscapeTicketItem_.getValue();
this.portraitRadioButton_.checked = !isLandscapeEnabled;
this.landscapeRadioButton_.checked = isLandscapeEnabled;
- fadeInOption(this.getElement());
- } else {
- fadeOutOption(this.getElement());
}
+ this.updateUiStateInternal();
}
};

Powered by Google App Engine
This is Rietveld 408576698