Index: chrome/browser/resources/shared/js/cr/ui/list.js |
diff --git a/chrome/browser/resources/shared/js/cr/ui/list.js b/chrome/browser/resources/shared/js/cr/ui/list.js |
index 121703a0b9616db58c39f1e80b0f5b4cbdcb04c6..9a579d8f1aa4e9deb301b4b99f8f14f5d15ca648 100644 |
--- a/chrome/browser/resources/shared/js/cr/ui/list.js |
+++ b/chrome/browser/resources/shared/js/cr/ui/list.js |
@@ -269,6 +269,7 @@ cr.define('cr.ui', function() { |
var length = this.dataModel ? this.dataModel.length : 0; |
this.selectionModel = new ListSelectionModel(length); |
+ this.addEventListener('dblclick', this.handleDoubleClick_); |
this.addEventListener('mousedown', this.handleMouseDownUp_); |
this.addEventListener('mouseup', this.handleMouseDownUp_); |
this.addEventListener('keydown', this.handleKeyDown); |
@@ -290,6 +291,20 @@ cr.define('cr.ui', function() { |
}, |
/** |
+ * Callback for the double click event. |
+ * @param {Event} e The mouse event object. |
+ * @private |
+ */ |
+ handleDoubleClick_: function(e) { |
+ if (this.disabled) |
+ return; |
+ |
+ var target = this.getListItemAncestor(e.target); |
+ var index = target ? this.getIndexOfListItem(target) : -1; |
+ this.activateItemAtIndex(index); |
Evan Stade
2011/01/12 00:46:12
this is causing js errors in lists that don't impl
James Hawkins
2011/01/12 00:54:04
I guess I forgot to stub it out; I'll add the stub
|
+ }, |
+ |
+ /** |
* Callback for mousedown and mouseup events. |
* @param {Event} e The mouse event object. |
* @private |