| 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..5abc4e2f06cb5fc4961cf9d268e98b32a19d0f47 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,28 @@ 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 = e.target;
|
| +
|
| + // If the target was this element we need to make sure that the user did
|
| + // not click on a border or a scrollbar.
|
| + if (target == this && !inViewport(target, e))
|
| + return;
|
| +
|
| + target = this.getListItemAncestor(target);
|
| +
|
| + var index = target ? this.getIndexOfListItem(target) : -1;
|
| + this.activateItemAtIndex(index);
|
| + },
|
| +
|
| + /**
|
| * Callback for mousedown and mouseup events.
|
| * @param {Event} e The mouse event object.
|
| * @private
|
|
|