summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/print_preview
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/resources/print_preview')
-rw-r--r--chrome/browser/resources/print_preview/margin_settings.js14
-rw-r--r--chrome/browser/resources/print_preview/print_preview.js6
2 files changed, 11 insertions, 9 deletions
diff --git a/chrome/browser/resources/print_preview/margin_settings.js b/chrome/browser/resources/print_preview/margin_settings.js
index 5f48ed7..1e30663 100644
--- a/chrome/browser/resources/print_preview/margin_settings.js
+++ b/chrome/browser/resources/print_preview/margin_settings.js
@@ -172,24 +172,24 @@ cr.define('print_preview', function() {
/**
* @return {number} The value of the selected margin option.
- * @private
*/
- get selectedMarginsValue_() {
- return this.marginList_.options[this.marginList_.selectedIndex].value;
+ get selectedMarginsValue() {
+ var val = this.marginList_.options[this.marginList_.selectedIndex].value;
+ return parseInt(val, 10);
},
/**
* @return {boolean} True if default margins are selected.
*/
isDefaultMarginsSelected: function() {
- return this.selectedMarginsValue_ == MarginSettings.MARGINS_VALUE_DEFAULT;
+ return this.selectedMarginsValue == MarginSettings.MARGINS_VALUE_DEFAULT;
},
/**
* @return {boolean} True if no margins are selected.
*/
isNoMarginsSelected: function() {
- return this.selectedMarginsValue_ ==
+ return this.selectedMarginsValue ==
MarginSettings.MARGINS_VALUE_NO_MARGINS;
},
@@ -197,7 +197,7 @@ cr.define('print_preview', function() {
* @return {boolean} True if custom margins are selected.
*/
isCustomMarginsSelected: function() {
- return this.selectedMarginsValue_ == MarginSettings.MARGINS_VALUE_CUSTOM;
+ return this.selectedMarginsValue == MarginSettings.MARGINS_VALUE_CUSTOM;
},
/**
@@ -360,7 +360,7 @@ cr.define('print_preview', function() {
else if (this.isCustomMarginsSelected())
this.onCustomMarginsSelected_();
- this.lastSelectedOption_ = this.selectedMarginsValue_;
+ this.lastSelectedOption_ = this.selectedMarginsValue;
},
/**
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index 13fde31d..5378744 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -355,11 +355,13 @@ function getSettings() {
'printWithCloudPrint': printWithCloudPrint,
'isFirstRequest' : false,
'headerFooterEnabled': headerFooterSettings.hasHeaderFooter(),
- 'defaultMarginsSelected': marginSettings.isDefaultMarginsSelected(),
- 'margins': marginSettings.customMargins,
+ 'marginsType': marginSettings.selectedMarginsValue,
'requestID': -1,
'generateDraftData': generateDraftData};
+ if (marginSettings.isCustomMarginsSelected())
+ settings['marginsCustom'] = marginSettings.customMargins;
+
var printerList = $('printer-list');
var selectedPrinter = printerList.selectedIndex;
if (cloudprint.isCloudPrint(printerList.options[selectedPrinter])) {