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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/list.js

Issue 6034005: DOMUI: Implement the new-style Autofill options page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes 2. Created 10 years 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
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

Powered by Google App Engine
This is Rietveld 408576698