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

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

Issue 8273026: [Multi Profile] Double-clicking an item in the user list should edit that profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/personal_options_profile_list.js
diff --git a/chrome/browser/resources/options/personal_options_profile_list.js b/chrome/browser/resources/options/personal_options_profile_list.js
index a27f04e751278a91258ec0b650a60a1b30f023c0..127416ed787024e99ec88d22f8137829640833fe 100644
--- a/chrome/browser/resources/options/personal_options_profile_list.js
+++ b/chrome/browser/resources/options/personal_options_profile_list.js
@@ -59,7 +59,7 @@ cr.define('options.personal_options', function() {
'profilesListItemCurrent',
profileInfo.name)
nameEl.textContent = displayName;
- },
+ }
James Hawkins 2011/10/14 20:51:24 Why did you remove the comma?
binji 2011/10/14 21:17:14 Strange, I thought it complained about it once.
};
var ProfileList = cr.ui.define('list');
@@ -71,6 +71,8 @@ cr.define('options.personal_options', function() {
decorate: function() {
DeletableItemList.prototype.decorate.call(this);
this.selectionModel = new ListSingleSelectionModel();
+
+ this.addEventListener('dblclick', this.handleDoubleClick_);
},
/** @inheritDoc */
@@ -83,6 +85,26 @@ cr.define('options.personal_options', function() {
deleteItemAtIndex: function(index) {
ManageProfileOverlay.showDeleteDialog(this.dataModel.item(index));
},
+
+ /**
+ * Callback for the double click event.
+ * @param {Event} e The mouse event object.
+ * @private
+ */
+ handleDoubleClick_: function(e) {
James Hawkins 2011/10/14 20:51:24 Hmm, logic for double clicking used to be handled
binji 2011/10/14 21:17:14 Done.
+ var target = this.getListItemAncestor(e.target);
+ if (target)
+ this.activateItemAtIndex(this.getIndexOfListItem(target));
+ },
+
+ /**
+ * Called when a list item is activated, currently only by a double click
+ * event.
+ * @param {number} index The index of the activated item.
+ */
+ activateItemAtIndex: function(index) {
+ ManageProfileOverlay.showManageDialog(this.dataModel.item(index));
+ }
};
return {
« 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