Chromium Code Reviews| Index: chrome/browser/resources/options/language_list.js |
| diff --git a/chrome/browser/resources/options/language_list.js b/chrome/browser/resources/options/language_list.js |
| index 1030a0ac70e449e6cd59f36bf21855a1f61d738e..922ec6c6bd4dc3c9a1d31d4a6afcb3d638e980ed 100644 |
| --- a/chrome/browser/resources/options/language_list.js |
| +++ b/chrome/browser/resources/options/language_list.js |
| @@ -389,22 +389,16 @@ cr.define('options', function() { |
| */ |
| load_: function(languageCodes) { |
| // Preserve the original selected index. See comments below. |
| - var originalSelectedIndex = (this.selectionModel ? |
| - this.selectionModel.selectedIndex : -1); |
| + var originalSelectedIndex = this.selectionModel.selectedIndex; |
| this.dataModel = new ArrayDataModel(languageCodes); |
| if (originalSelectedIndex >= 0 && |
| originalSelectedIndex < this.dataModel.length) { |
| // Restore the original selected index if the selected index is |
| - // valid after the data model is loaded. This is neeeded to keep |
| + // valid after the data model is loaded. This is needed to keep |
| // the selected language after the languge is added or removed. |
| this.selectionModel.selectedIndex = originalSelectedIndex; |
| // The lead index should be updated too. |
| this.selectionModel.leadIndex = originalSelectedIndex; |
| - } else if (this.dataModel.length > 0) { |
| - // Otherwise, select the first item if it's not empty. |
| - // Note that ListSingleSelectionModel won't select an item |
| - // automatically, hence we manually select the first item here. |
| - this.selectionModel.selectedIndex = 0; |
|
Dan Beam
2016/02/09 19:14:47
why are you removing this?
Kevin Bailey
2016/02/09 22:19:07
Sorry, left-over from a misunderstanding. Restored
|
| } |
| }, |