OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Creates a PrintHeader object. This object encapsulates all the elements | 9 * Creates a PrintHeader object. This object encapsulates all the elements |
10 * and logic related to the top part of the left pane in print_preview.html. | 10 * and logic related to the top part of the left pane in print_preview.html. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 updateSummary_: function() { | 81 updateSummary_: function() { |
82 var printToPDF = getSelectedPrinterName() == PRINT_TO_PDF; | 82 var printToPDF = getSelectedPrinterName() == PRINT_TO_PDF; |
83 var copies = printToPDF ? 1 : copiesSettings.numberOfCopies; | 83 var copies = printToPDF ? 1 : copiesSettings.numberOfCopies; |
84 | 84 |
85 if ((!printToPDF && !copiesSettings.isValid()) || | 85 if ((!printToPDF && !copiesSettings.isValid()) || |
86 !pageSettings.isPageSelectionValid()) { | 86 !pageSettings.isPageSelectionValid()) { |
87 this.summary_.innerHTML = ''; | 87 this.summary_.innerHTML = ''; |
88 return; | 88 return; |
89 } | 89 } |
90 | 90 |
| 91 if (!marginSettings.areMarginSettingsValid()) { |
| 92 this.summary_.innerHTML = ''; |
| 93 return; |
| 94 } |
| 95 |
91 var pageSet = pageSettings.selectedPagesSet; | 96 var pageSet = pageSettings.selectedPagesSet; |
92 var numOfSheets = pageSet.length; | 97 var numOfSheets = pageSet.length; |
93 var summaryLabel = | 98 var summaryLabel = |
94 localStrings.getString('printPreviewSheetsLabelSingular'); | 99 localStrings.getString('printPreviewSheetsLabelSingular'); |
95 var numOfPagesText = ''; | 100 var numOfPagesText = ''; |
96 var pagesLabel = localStrings.getString('printPreviewPageLabelPlural'); | 101 var pagesLabel = localStrings.getString('printPreviewPageLabelPlural'); |
97 | 102 |
98 if (printToPDF) | 103 if (printToPDF) |
99 summaryLabel = localStrings.getString('printPreviewPageLabelSingular'); | 104 summaryLabel = localStrings.getString('printPreviewPageLabelSingular'); |
100 | 105 |
(...skipping 22 matching lines...) Expand all Loading... |
123 // Removing extra spaces from within the string. | 128 // Removing extra spaces from within the string. |
124 html = html.replace(/\s{2,}/g, ' '); | 129 html = html.replace(/\s{2,}/g, ' '); |
125 this.summary_.innerHTML = html; | 130 this.summary_.innerHTML = html; |
126 }, | 131 }, |
127 }; | 132 }; |
128 | 133 |
129 return { | 134 return { |
130 PrintHeader: PrintHeader, | 135 PrintHeader: PrintHeader, |
131 }; | 136 }; |
132 }); | 137 }); |
OLD | NEW |