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

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

Issue 7903001: Improve Tab-key navigation for editing Autofill addresses and credit cards. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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/options/inline_editable_list.js
diff --git a/chrome/browser/resources/options/inline_editable_list.js b/chrome/browser/resources/options/inline_editable_list.js
index 6cd088667f92dfe1c623efc5e869003d7b01e92e..6eeb3834f77bc06af2b6fcc8c17f0a1162e2b6d0 100644
--- a/chrome/browser/resources/options/inline_editable_list.js
+++ b/chrome/browser/resources/options/inline_editable_list.js
@@ -83,18 +83,6 @@ 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;
- },
Ilya Sherman 2011/09/15 04:10:39 This was moved to deletable_item_list.js.
-
- /**
* Called when this element gains or loses 'lead' status. Updates editing
* mode accordingly.
* @private
@@ -122,12 +110,8 @@ cr.define('options', function() {
if (this.editing == editing)
return;
- if (editing)
+ if (editing) {
this.setAttribute('editing', '');
- else
- this.removeAttribute('editing');
Ilya Sherman 2011/09/15 04:10:39 This if/else got merged with the if/else below.
James Hawkins 2011/09/15 19:28:02 This block was intentionally kept separate from be
Ilya Sherman 2011/09/15 20:39:01 Ok, restored, though I find the second block harde
-
- if (editing) {
this.editCancelled_ = false;
cr.dispatchSimpleEvent(this, 'edit', true);
@@ -142,13 +126,14 @@ cr.define('options', function() {
if (focusElement) {
window.setTimeout(function() {
// Make sure we are still in edit mode by the time we execute.
- if (self.editing && self.focusPlaceholder) {
Ilya Sherman 2011/09/15 04:10:39 List items don't have a 'focusPlaceholder' propert
James Hawkins 2011/09/15 19:28:02 But InlineEditableLists do...
Ilya Sherman 2011/09/15 20:39:01 InlineEditableItemLists have this property. Inlin
+ if (self.editing) {
focusElement.focus();
focusElement.select();
}
}, 50);
}
} else {
+ this.removeAttribute('editing');
if (!this.editCancelled_ && this.hasBeenEdited &&
this.currentInputIsValid) {
if (this.isPlaceholder)

Powered by Google App Engine
This is Rietveld 408576698