Index: chrome/browser/resources/print_preview/header_footer_settings.js |
diff --git a/chrome/browser/resources/print_preview/header_footer_settings.js b/chrome/browser/resources/print_preview/header_footer_settings.js |
index 50b645ed762ad43aefb23b8e1511a1561da43130..e643d92984971becfa679fd992d71fb7bf744b09 100644 |
--- a/chrome/browser/resources/print_preview/header_footer_settings.js |
+++ b/chrome/browser/resources/print_preview/header_footer_settings.js |
@@ -44,6 +44,13 @@ cr.define('print_preview', function() { |
this.onHeaderFooterChanged_.bind(this); |
document.addEventListener(customEvents.PDF_LOADED, |
this.onPDFLoaded_.bind(this)); |
+ document.addEventListener(customEvents.MARGINS_SELECTION_CHANGED, |
+ this.onMarginsSelectionChanged_.bind(this)); |
+ }, |
+ |
+ onMarginsSelectionChanged_: function(event) { |
+ this.setVisible_(event.selectedMargins != |
+ print_preview.MarginSettings.MARGINS_VALUE_NO_MARGINS); |
}, |
/** |
@@ -60,7 +67,19 @@ cr.define('print_preview', function() { |
* @private |
*/ |
onPDFLoaded_: function() { |
- if (!previewModifiable) { |
+ if (!previewModifiable) |
+ this.setVisible_(previewModifiable); |
+ }, |
+ |
+ /** |
+ * Hides or shows |this.headerFooterOption|. |
+ * @{param} visible True if |this.headerFooterOption| should be shown. |
+ * @private |
+ */ |
+ setVisible_: function(visible) { |
+ if (visible) { |
+ fadeInOption(this.headerFooterOption_); |
+ } else { |
fadeOutOption(this.headerFooterOption_); |
this.headerFooterCheckbox_.checked = false; |
dpapad
2011/11/29 17:29:09
When hiding this option we also set it to not chec
kmadhusu
2011/11/29 17:48:59
Consider the following scenario:
1. User previews
dpapad
2011/11/29 19:32:07
Done.
|
} |