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

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

Issue 7607027: Options: Two fixes for Autofill lists. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « no previous file | chrome/browser/resources/options/inline_editable_list.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/autofill_options_list.js
diff --git a/chrome/browser/resources/options/autofill_options_list.js b/chrome/browser/resources/options/autofill_options_list.js
index 86aaae84aa536f775996e963402a9d6b783e822d..2d343bdd9617678f933091aba105186468cece97 100644
--- a/chrome/browser/resources/options/autofill_options_list.js
+++ b/chrome/browser/resources/options/autofill_options_list.js
@@ -169,7 +169,7 @@ cr.define('options.autofillOptions', function() {
*/
onEditCommitted_: function(e) {
var i = this.list.items.indexOf(this);
- if (i < 0 || i >= this.list.dataModel.length)
+ if (i < 0 || i >= this.list.dataModel.length || !this.input.value.length)
return;
if (this.input.value &&
@@ -180,7 +180,6 @@ cr.define('options.autofillOptions', function() {
this.list.validateAndSave(i, 0, this.input.value);
} else {
this.input.value = '';
- this.list.dataModel.updateIndex(i);
}
},
};
@@ -307,6 +306,11 @@ cr.define('options.autofillOptions', function() {
this.dataModel.splice(index, 1);
},
+ /** @inheritDoc */
+ shouldFocusPlaceholder: function() {
csilv 2011/08/10 17:55:25 odd that we consider "placeholder" a word? not su
+ return false;
+ },
+
/**
* Called when a new list item should be validated; subclasses are
* responsible for implementing if validation is required.
« no previous file with comments | « no previous file | chrome/browser/resources/options/inline_editable_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698