X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fclose_on_esc.js;h=503c57204c3b4be211035441fdb3ad4418a191a0;hb=1412adb259a6ddcbbaa7c08f04e2e3bb86bad5f2;hp=0bf8eeb7a0b9195beffa6c0d915107f5e080cdf4;hpb=8a0d8a28c76f04c06788a53725dca849538ebbe4;p=platal.git diff --git a/htdocs/javascript/close_on_esc.js b/htdocs/javascript/close_on_esc.js index 0bf8eeb..503c572 100644 --- a/htdocs/javascript/close_on_esc.js +++ b/htdocs/javascript/close_on_esc.js @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003-2004 Polytechnique.org * + * Copyright (C) 2003-2009 Polytechnique.org * * http://opensource.polytechnique.org/ * * * * This program is free software; you can redistribute it and/or modify * @@ -18,12 +18,11 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -function closePopup(e) { - e = e || window.event; - if (e.keyCode == 27) { - window.close(); - } -} - -attachEvent(window, 'keydown', closePopup); +$(window).keydown( + function(e) { + if (e.keyCode == 27) { + window.close(); + } + }); +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: