From: Mark Wooding Date: Sat, 13 Apr 2013 23:13:00 +0000 (+0100) Subject: chpwd.js: Provide the CAPTUREP argument to `addEventListener'. X-Git-Tag: 1.0.2~6 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/chopwood/commitdiff_plain/eaac44f3ca7ffee0dd428830aa40e0917df122fc?ds=sidebyside chpwd.js: Provide the CAPTUREP argument to `addEventListener'. Otherwise MicroB, at least, raises an exception and none of the remaining JavaScript will run. --- diff --git a/chpwd.js b/chpwd.js index 9ad74ad..a271db4 100644 --- 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 -------------------------------------------------*/