Unreviewed, rolling out r129521.
[WebKit-https.git] / Websites / bugs.webkit.org / committers-autocomplete.js
index 70442d7a06390b0c81e4e6deec92eaeeef3e16fe..084b50d02b4095316f23b8b820b1ee536f13f218 100644 (file)
@@ -391,11 +391,14 @@ WebKitCommitters = (function() {
         updateMenu();
     }
 
-    for (var i = 0; i < EMAIL_INPUTS.length; i++) {
-        var field = document.getElementById(EMAIL_INPUTS[i]);
-        if (field)
-            field.addEventListener("focus", function(e) { enableAutoComplete(e.target); }, false);
-    }
+    document.addEventListener('focusin', function(e) {
+        for (var i = 0; i < EMAIL_INPUTS.length; i++) {
+            if (e.target.name == EMAIL_INPUTS[i]) {
+                enableAutoComplete(e.target);
+                break;
+            }
+        }
+    }, false);
 
     WebKitCommitters.getCommitters(function (committers) {
         m_committers = committers;