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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/menu_button.js

Issue 10966027: Basic keyboard access for recently_closed menu on NTP. Allows using up and down arrows to navigate,… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Get rid of pointless experimental code" Created 8 years, 3 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
Index: chrome/browser/resources/shared/js/cr/ui/menu_button.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/menu_button.js b/chrome/browser/resources/shared/js/cr/ui/menu_button.js
index 3363babb65b5bd3f2ffa490243c1da3f9aed5566..535535e6c421726b2978337a1e058f6a09fae291 100644
--- a/chrome/browser/resources/shared/js/cr/ui/menu_button.js
+++ b/chrome/browser/resources/shared/js/cr/ui/menu_button.js
@@ -100,7 +100,6 @@ cr.define('cr.ui', function() {
break;
case 'activate':
- case 'blur':
case 'resize':
this.hideMenu();
break;
@@ -120,6 +119,7 @@ cr.define('cr.ui', function() {
this.menu.hidden = false;
this.setAttribute('menu-shown', '');
+ this.menu.selectedIndex = 0;
Dan Beam 2012/09/21 03:44:50 should the first item always be selected when show
aboxhall 2012/09/21 06:46:00 The selectedIndex is set back to -1 below, so it s
Dan Beam 2012/09/21 10:23:48 Where is it set to -1? Either way I guess this met
aboxhall 2012/09/24 00:48:52 It's set to -1 in the hideMenu() method below. I
// when the menu is shown we steal all keyboard events.
var doc = this.ownerDocument;
@@ -146,6 +146,7 @@ cr.define('cr.ui', function() {
this.showingEvents_.removeAll();
this.menu.selectedIndex = -1;
+ this.focus();
Dan Beam 2012/09/21 03:44:50 I'm confused by this ^
aboxhall 2012/09/21 06:46:00 It puts the focus back on the menu button when the
Dan Beam 2012/09/21 10:23:48 How does focus()ing a hidden element put the focus
aboxhall 2012/09/24 00:48:52 It's not focusing a hidden element, it's focusing
},
/**
@@ -179,6 +180,7 @@ cr.define('cr.ui', function() {
e.preventDefault();
break;
case 'Esc':
+ case 'U+0009':
Dan Beam 2012/09/21 03:44:50 case 'U+0009': // Whatever the heck this key is.
Dan Beam 2012/09/21 10:23:48 Ping
aboxhall 2012/09/24 00:48:52 Oopsies. It's 'Tab'. Fixed.
case 'U+001B': // Maybe this is remote desktop playing a prank?
this.hideMenu();
break;

Powered by Google App Engine
This is Rietveld 408576698