Chromium Code Reviews| Index: chrome/browser/resources/options/deletable_item_list.js |
| diff --git a/chrome/browser/resources/options/deletable_item_list.js b/chrome/browser/resources/options/deletable_item_list.js |
| index 4f223bad57802ee00c8472335ac9d6207863a788..d625dc5a7ca705e0e27b6957a40019c28818e22a 100644 |
| --- a/chrome/browser/resources/options/deletable_item_list.js |
| +++ b/chrome/browser/resources/options/deletable_item_list.js |
| @@ -136,18 +136,15 @@ cr.define('options', function() { |
| var target = e.target; |
| if (target.classList.contains('row-delete-button')) { |
| + // Because the close buttons do not give any visual indication that they |
| + // would behave differently when multiple items are selected, delete |
| + // only the one list item that contains the close button being clicked, |
| + // regardless of how many other items are selected. If the user wants to |
| + // delete a lot of stuff at once, he would have to press the delete key. |
|
Evan Stade
2014/07/31 15:09:26
I think this comment is too much. Better to make t
engedy
2014/07/31 16:36:53
Moved it to the CL description, and replaced it wi
|
| var listItem = this.getListItemAncestor(target); |
| - var selected = this.selectionModel.selectedIndexes; |
| - |
| - // Check if the list item that contains the close button being clicked |
| - // is not in the list of selected items. Only delete this item in that |
| - // case. |
| var idx = this.getIndexOfListItem(listItem); |
| - if (selected.indexOf(idx) == -1) { |
| - this.deleteItemAtIndex(idx); |
| - } else { |
| - this.deleteSelectedItems_(); |
| - } |
| + this.deleteItemAtIndex(idx); |
| + this.selectionModel.clear(); |
|
engedy
2014/07/31 09:30:22
What is the motivation for clearing the selection?
Evan Stade
2014/07/31 15:09:27
It's my impression that that is the expected behav
engedy
2014/07/31 16:36:53
Sorry, turns out my above statement was incorrect:
|
| } |
| }, |