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

Unified Diff: chrome/browser/resources/options/browser_options.js

Issue 727303005: options: Fix focus "Show advanced settings..." click focus regression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hacky-- Created 6 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
« 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/options/browser_options.js
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index c92fa1df42bc7c5c4bc0e7ca50512076fd3a49ad..d6a1bb078552e12830d58a676a512aee3ad6cebd 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -116,7 +116,7 @@ cr.define('options', function() {
window.addEventListener('message', this.handleWindowMessage_.bind(this));
if (loadTimeData.getBoolean('allowAdvancedSettings')) {
- $('advanced-settings-expander').onclick = function() {
+ $('advanced-settings-expander').onclick = function(e) {
var showAdvanced =
BrowserOptions.shouldShowSection_($('advanced-settings'));
if (showAdvanced) {
@@ -127,11 +127,10 @@ cr.define('options', function() {
$('advanced-settings'),
$('advanced-settings-container'));
- // If the link was focused (i.e., it was activated using the keyboard)
- // and it was used to show the section (rather than hiding it), focus
- // the first element in the container.
- if (document.activeElement === $('advanced-settings-expander') &&
- showAdvanced) {
+ // If the click was triggered using the keyboard and it showed the
+ // section (rather than hiding it), focus the first element in the
+ // container.
+ if (e.detail == 0 && showAdvanced) {
var focusElement = $('advanced-settings-container').querySelector(
'button, input, list, select, a[href]');
if (focusElement)
« 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