X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fclose_on_esc.js;h=0ff10ad6358e48a38c053c3456b95c5c55fc914b;hb=076412639089ff7a5dfd8ae1652faf1683c322e5;hp=a60e9a651c21a2c107438019ddef256ea330b676;hpb=50a40a33a496131e817df875607ea5542d096a64;p=platal.git diff --git a/htdocs/javascript/close_on_esc.js b/htdocs/javascript/close_on_esc.js index a60e9a6..0ff10ad 100644 --- a/htdocs/javascript/close_on_esc.js +++ b/htdocs/javascript/close_on_esc.js @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003-2006 Polytechnique.org * + * Copyright (C) 2003-2008 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: