Commit dac183b9 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview Componentization: Fix bugs found during Windows testing

Bug: 773928
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I329273eb229f63be362e551cb67f8472e1867ae8
Reviewed-on: https://chromium-review.googlesource.com/972198Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544774}
parent f39c1886
......@@ -88,13 +88,13 @@ Polymer({
*/
computeLabelInfo_: function() {
const saveToPdfOrDrive = this.isPdfOrDrive_();
let numPages = this.getSetting('pages').value.length;
let numPages = this.getSettingValue('pages').length;
let numSheets = numPages;
if (!saveToPdfOrDrive && this.getSetting('duplex').value) {
if (!saveToPdfOrDrive && this.getSettingValue('duplex')) {
numSheets = Math.ceil(numPages / 2);
}
const copies = /** @type {number} */ (this.getSetting('copies').value);
const copies = parseInt(this.getSettingValue('copies'), 10);
numSheets *= copies;
numPages *= copies;
......
......@@ -365,7 +365,7 @@ Polymer({
this.set('settings.dpi.value', defaultOption);
} else if (
caps && caps.dpi && caps.dpi.option && caps.dpi.option.length > 0) {
this.set('settings.dpi.value', caps.dpi.option[0]);
this.set('settings.dpi.unavailableValue', caps.dpi.option[0]);
}
if (this.settings.vendorItems.available) {
......@@ -518,7 +518,7 @@ Polymer({
duplex: this.getSettingValue('duplex') ?
print_preview_new.DuplexMode.LONG_EDGE :
print_preview_new.DuplexMode.SIMPLEX,
copies: this.getSettingValue('copies'),
copies: parseInt(this.getSettingValue('copies'), 10),
collate: this.getSettingValue('collate'),
shouldPrintBackgrounds: this.getSettingValue('cssBackground'),
shouldPrintSelectionOnly: false, // only used in print preview
......
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