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

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

Issue 8394020: Print Preview: Improving accessibility of margins UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 9 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 | « no previous file | chrome/browser/resources/print_preview/margin_textbox.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 819d79fc0ede01d2eef1fc6b049990a3c7752efe..15a6603ea1ebda725a4a4a080b82bd3caafa4a07 100644
--- a/chrome/browser/resources/print_preview/margin_settings.js
+++ b/chrome/browser/resources/print_preview/margin_settings.js
@@ -267,7 +267,7 @@ cr.define('print_preview', function() {
*/
onSidebarMouseOver_: function(e) {
if (!this.forceDisplayingMarginLines_)
- this.marginsUI.hide();
+ this.marginsUI.hide(false);
},
/**
@@ -298,7 +298,7 @@ cr.define('print_preview', function() {
onPDFGenerationError_: function() {
if (this.isCustomMarginsSelected()) {
this.removeCustomMarginEventListeners_();
- this.marginsUI.hide();
+ this.marginsUI.hide(true);
}
},
@@ -426,6 +426,8 @@ cr.define('print_preview', function() {
$('sidebar').onmouseover = this.onSidebarMouseOver_.bind(this);
this.eventTracker_.add(
this.marginsUI, 'DragEvent', this.onDragEvent_.bind(this), false);
+ this.eventTracker_.add(document, 'marginTextboxFocused',
+ this.onMarginTextboxFocused_.bind(this), false);
},
/**
@@ -436,7 +438,8 @@ cr.define('print_preview', function() {
$('mainview').onmouseover = null;
$('sidebar').onmouseover = null;
this.eventTracker_.remove(this.marginsUI, 'DragEvent');
- this.marginsUI.hide();
+ this.eventTracker_.remove(document, 'marginTextboxFocused');
+ this.marginsUI.hide(true);
},
/**
@@ -470,6 +473,16 @@ cr.define('print_preview', function() {
},
/**
+ * Executes when a margin textbox is focused. Used for improved
+ * accessibility.
+ * @private
+ */
+ onMarginTextboxFocused_: function() {
+ this.forceDisplayingMarginLines_ = true;
+ this.marginsUI.show();
+ },
+
+ /**
* Executes when user selects a different margin option, ie,
* |this.marginList_.selectedIndex| is changed.
* @private
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/margin_textbox.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698