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 { |