summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-03 20:28:21 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-03 20:28:21 +0000
commit19392dec3377bd7af0b4a769659b0e83632ade84 (patch)
tree5fc5ba9750a64a9bf7657738f35c90131f1b749f
parent71013872bf6113ba436fd8c4a70b738c8b6cccf6 (diff)
downloadchromium_src-19392dec3377bd7af0b4a769659b0e83632ade84.zip
chromium_src-19392dec3377bd7af0b4a769659b0e83632ade84.tar.gz
chromium_src-19392dec3377bd7af0b4a769659b0e83632ade84.tar.bz2
Options: Fix the startup pages list.
* List was disabled even though the radio was checked. * When the list input gets focus (via tab), set this item as the selected index. BUG=89614 TEST=none R=csilv@chromium.or Review URL: http://codereview.chromium.org/7566013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95301 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/options/browser_options.js2
-rw-r--r--chrome/browser/resources/options/inline_editable_list.js13
2 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
index 14808b8..9dd38c5 100644
--- a/chrome/browser/resources/options/browser_options.js
+++ b/chrome/browser/resources/options/browser_options.js
@@ -276,6 +276,8 @@ cr.define('options', function() {
if (items[i].value == value)
items[i].checked = true;
}
+
+ this.updateCustomStartupPageControlStates_();
},
/**
diff --git a/chrome/browser/resources/options/inline_editable_list.js b/chrome/browser/resources/options/inline_editable_list.js
index b01d4a3..b762a1d 100644
--- a/chrome/browser/resources/options/inline_editable_list.js
+++ b/chrome/browser/resources/options/inline_editable_list.js
@@ -83,6 +83,18 @@ cr.define('options', function() {
},
/**
+ * Called when the input element receives focus. Selects this item in the
+ * list selection model.
+ * @private
+ */
+ handleFocus_: function() {
+ var list = this.parentNode;
+ var index = list.getIndexOfListItem(this);
+ list.selectionModel.selectedIndex = index;
+ list.selectionModel.anchorIndex = index;
+ },
+
+ /**
* Called when this element gains or loses 'lead' status. Updates editing
* mode accordingly.
* @private
@@ -231,6 +243,7 @@ cr.define('options', function() {
inputEl.setAttribute('displaymode', 'edit');
inputEl.staticVersion = textEl;
}
+ inputEl.addEventListener('focus', this.handleFocus_.bind(this));
container.appendChild(inputEl);
this.editFields_.push(inputEl);