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

Unified Diff: chrome/browser/resources/print_preview/margin_settings.js

Issue 8592003: Print Preview: Fixing javascript error occuring in the margins code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Creating getter in previewArea Created 9 years, 1 month 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/margin_settings.js
diff --git a/chrome/browser/resources/print_preview/margin_settings.js b/chrome/browser/resources/print_preview/margin_settings.js
index 1bfed187a0a908c88905392414c3b1bfa14fe1cd..14ecac14ef68a86c55daf893ecb9e43a4c6f5b2d 100644
--- a/chrome/browser/resources/print_preview/margin_settings.js
+++ b/chrome/browser/resources/print_preview/margin_settings.js
@@ -535,8 +535,11 @@ cr.define('print_preview', function() {
* Called when there is change in the preview position or size.
*/
onPreviewPositionChanged: function() {
+ if (!previewArea.pdfPlugin)
+ return;
if (this.isCustomMarginsSelected() && previewArea.pdfLoaded &&
pageSettings.totalPageCount != undefined) {
+ this.updatePageData_();
kmadhusu 2011/11/21 19:20:22 Can you explain why you need to update the page da
dpapad 2011/11/22 02:05:10 Yes. cutomMargins_ might not be initialized when t
this.drawCustomMarginsUI_();
}
},
@@ -580,6 +583,10 @@ cr.define('print_preview', function() {
* @private
*/
onCustomMarginsSelected_: function() {
+ if (!previewArea.pdfPlugin) {
+ this.forceMarginsUIOnPDFLoad_ = true;
+ return;
+ }
var customMarginsNotSpecified = !this.customMargins_;
this.updatePageData_();

Powered by Google App Engine
This is Rietveld 408576698