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

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

Issue 7563018: Merge 95301 - Options: Fix the startup pages list. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/835/src/
Patch Set: Created 9 years, 5 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/options/browser_options.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/inline_editable_list.js
===================================================================
--- chrome/browser/resources/options/inline_editable_list.js (revision 95304)
+++ chrome/browser/resources/options/inline_editable_list.js (working copy)
@@ -83,6 +83,18 @@
},
/**
+ * 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 @@
inputEl.setAttribute('displaymode', 'edit');
inputEl.staticVersion = textEl;
}
+ inputEl.addEventListener('focus', this.handleFocus_.bind(this));
container.appendChild(inputEl);
this.editFields_.push(inputEl);
« no previous file with comments | « chrome/browser/resources/options/browser_options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698