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

Unified Diff: chrome/browser/resources/print_preview/previewarea/margin_control.js

Issue 1954763003: Merge "print_preview: Workaround of focus-scroll issue." to M51 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/previewarea/margin_control.js
diff --git a/chrome/browser/resources/print_preview/previewarea/margin_control.js b/chrome/browser/resources/print_preview/previewarea/margin_control.js
index 7ec2527e7a17e02389387adba3c9c806b7ec8b3d..061a989d311279ea6581cf2949db22f0e29c217b 100644
--- a/chrome/browser/resources/print_preview/previewarea/margin_control.js
+++ b/chrome/browser/resources/print_preview/previewarea/margin_control.js
@@ -349,6 +349,17 @@ cr.define('print_preview', function() {
*/
setIsFocused_: function(isFocused) {
this.isFocused_ = isFocused;
+ // TODO(tkent): This is a workaround of a preview-area scrolling
+ // issue. Blink scrolls preview-area on focus, but we don't want it. We
+ // should adjust scroll position of PDF preview and positions of
+ // MarginContgrols here, or restructure the HTML so that the PDF review
+ // and MarginControls are on the single scrollable container.
+ // crbug.com/601341
+ if (isFocused) {
+ var previewArea = $('preview-area');
+ previewArea.scrollTop = 0;
+ previewArea.scrollLeft = 0;
+ }
},
/**
@@ -378,8 +389,9 @@ cr.define('print_preview', function() {
if (event.propertyName != 'opacity')
return;
var elStyle = window.getComputedStyle(this.getElement());
- var opacity = parseInt(elStyle.getPropertyValue('opacity'), 10);
- this.textbox_.setAttribute('aria-hidden', opacity == 0);
+ var disabled = parseInt(elStyle.getPropertyValue('opacity'), 10) == 0;
+ this.textbox_.setAttribute('aria-hidden', disabled);
+ this.textbox_.disabled = disabled;
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698