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

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: 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..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:
}
},
« 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