chiark / gitweb /
chpwd.js: Provide the CAPTUREP argument to `addEventListener'.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 13 Apr 2013 23:13:00 +0000 (00:13 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 13 Apr 2013 23:13:00 +0000 (00:13 +0100)
Otherwise MicroB, at least, raises an exception and none of the
remaining JavaScript will run.

chpwd.js

index 9ad74ad..a271db4 100644 (file)
--- a/chpwd.js
+++ b/chpwd.js
@@ -130,19 +130,19 @@ function init() {
     // properly.
     for (w in form.elts) {
       if ((e = elt(f + '-' + form.elts[w])) === null) continue;
-      e.addEventListener('click', check_soon);
-      e.addEventListener('change', check_soon);
-      e.addEventListener('keypress', check_soon);
-      e.addEventListener('blur', check_soon);
+      e.addEventListener('click', check_soon, false);
+      e.addEventListener('change', check_soon, false);
+      e.addEventListener('keypress', check_soon, false);
+      e.addEventListener('blur', check_soon, false);
     }
     if ((e = elt(f + '-submit')) !== null) {
       e.addEventListener('click', function (ev) {
        return check_presubmit(ev, f)
-      });
+      }, false);
     }
   })(f, FORMS[f]);
 }
 
-window.addEventListener('load', init);
+window.addEventListener('load', init, false);
 
 /*----- That's all, folks -------------------------------------------------*/