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

Side by Side Diff: chrome/browser/resources/options/autofill_options_list.js

Issue 7038024: Move sorting logic from table to list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed autofill phones. Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('options.autofillOptions', function() { 5 cr.define('options.autofillOptions', function() {
6 const DeletableItem = options.DeletableItem; 6 const DeletableItem = options.DeletableItem;
7 const DeletableItemList = options.DeletableItemList; 7 const DeletableItemList = options.DeletableItemList;
8 const InlineEditableItem = options.InlineEditableItem; 8 const InlineEditableItem = options.InlineEditableItem;
9 const InlineEditableItemList = options.InlineEditableItemList; 9 const InlineEditableItemList = options.InlineEditableItemList;
10 10
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 * @extends {options.ValuesListItem} 167 * @extends {options.ValuesListItem}
168 * @private 168 * @private
169 */ 169 */
170 onEditCommitted_: function(e) { 170 onEditCommitted_: function(e) {
171 var i = this.list.items.indexOf(this); 171 var i = this.list.items.indexOf(this);
172 if (i < 0 || i >= this.list.dataModel.length) 172 if (i < 0 || i >= this.list.dataModel.length)
173 return; 173 return;
174 174
175 if (this.input.value && 175 if (this.input.value &&
176 this.list.dataModel.indexOf(this.input.value) == -1) { 176 this.list.dataModel.indexOf(this.input.value) == -1) {
177 // It is important that updateIndex is done before validateAndSave.
178 // Otherwise we can not be sure about AddRow index.
179 this.list.dataModel.updateIndex(i);
177 this.list.validateAndSave(i, 0, this.input.value); 180 this.list.validateAndSave(i, 0, this.input.value);
178 } else { 181 } else {
179 this.input.value = ''; 182 this.input.value = '';
180 this.list.dataModel.updateIndex(i); 183 this.list.dataModel.updateIndex(i);
181 } 184 }
182 }, 185 },
183 }; 186 };
184 187
185 /** 188 /**
186 * Create a new address list. 189 * Create a new address list.
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 CreditCardListItem: CreditCardListItem, 376 CreditCardListItem: CreditCardListItem,
374 ValuesListItem: ValuesListItem, 377 ValuesListItem: ValuesListItem,
375 ValuesAddRowListItem: ValuesAddRowListItem, 378 ValuesAddRowListItem: ValuesAddRowListItem,
376 AutofillAddressList: AutofillAddressList, 379 AutofillAddressList: AutofillAddressList,
377 AutofillCreditCardList: AutofillCreditCardList, 380 AutofillCreditCardList: AutofillCreditCardList,
378 AutofillValuesList: AutofillValuesList, 381 AutofillValuesList: AutofillValuesList,
379 AutofillPhoneValuesList: AutofillPhoneValuesList, 382 AutofillPhoneValuesList: AutofillPhoneValuesList,
380 AutofillFaxValuesList: AutofillFaxValuesList, 383 AutofillFaxValuesList: AutofillFaxValuesList,
381 }; 384 };
382 }); 385 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/main.html ('k') | chrome/browser/resources/shared/js/cr/ui/array_data_model.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698