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

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

Issue 435553003: DeletableItemList: Make 'X' button delete only the one list item that contains it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed (some) comments. Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4941921cd8c0da765485ce196449c6ef146c8841 100644
--- a/chrome/browser/resources/options/deletable_item_list.js
+++ b/chrome/browser/resources/options/deletable_item_list.js
@@ -136,18 +136,11 @@ cr.define('options', function() {
var target = e.target;
if (target.classList.contains('row-delete-button')) {
+ // A close button does not give any visual indication that its behavior
+ // would be affected by the current selection, so it should not be.
Evan Stade 2014/07/31 19:36:07 I just don't think that code comments are the best
engedy 2014/08/01 08:06:25 Done, I have removed the comment.
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);
}
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698