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

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

Issue 680403002: Fix Print Preview navbar links layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merging with head. Created 6 years, 2 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 | « chrome/browser/resources/print_preview/print_preview.css ('k') | 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/print_preview.js
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js
index d2ed7e0fc7f50abd68eb0842b37fb956af87d2bf..b93440205a1a64ba7dffb73c32da8dd5ab14ca31 100644
--- a/chrome/browser/resources/print_preview/print_preview.js
+++ b/chrome/browser/resources/print_preview/print_preview.js
@@ -476,9 +476,9 @@ cr.define('print_preview', function() {
*/
setIsEnabled_: function(isEnabled) {
if ($('system-dialog-link'))
- $('system-dialog-link').disabled = !isEnabled;
+ $('system-dialog-link').classList.toggle('disabled', !isEnabled);
if ($('open-pdf-in-preview-link'))
- $('open-pdf-in-preview-link').disabled = !isEnabled;
+ $('open-pdf-in-preview-link').classList.toggle('disabled', !isEnabled);
this.printHeader_.isEnabled = isEnabled;
this.destinationSettings_.isEnabled = isEnabled;
this.pageSettings_.isEnabled = isEnabled;
@@ -583,6 +583,8 @@ cr.define('print_preview', function() {
openSystemPrintDialog_: function() {
if (!this.shouldShowSystemDialogLink_())
return;
+ if ($('system-dialog-link').classList.contains('disabled'))
+ return;
if (cr.isWindows) {
this.showSystemDialogBeforeNextPrint_ = true;
this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/);
@@ -802,6 +804,8 @@ cr.define('print_preview', function() {
* @private
*/
onOpenPdfInPreviewLinkClick_: function() {
+ if ($('open-pdf-in-preview-link').classList.contains('disabled'))
+ return;
assert(this.uiState_ == PrintPreview.UiState_.READY,
'Trying to open pdf in preview when not in ready state: ' +
this.uiState_);
@@ -886,12 +890,13 @@ cr.define('print_preview', function() {
if (e.keyCode == 13 /*enter*/ &&
!document.querySelector('.overlay:not([hidden])') &&
this.destinationStore_.selectedDestination &&
- this.printTicketStore_.isTicketValid()) {
+ this.printTicketStore_.isTicketValid() &&
+ this.printHeader_.isPrintButtonEnabled) {
assert(this.uiState_ == PrintPreview.UiState_.READY,
'Trying to print when not in ready state: ' + this.uiState_);
- var activeElementTag = document.activeElement ?
- document.activeElement.tagName.toUpperCase() : '';
- if (activeElementTag != 'BUTTON' && activeElementTag != 'SELECT') {
+ var activeElementTag = document.activeElement.tagName.toUpperCase();
+ if (activeElementTag != 'BUTTON' && activeElementTag != 'SELECT' &&
+ activeElementTag != 'A') {
this.printDocumentOrOpenPdfPreview_(false /*isPdfPreview*/);
e.preventDefault();
}
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698