X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fclose_on_esc.js;h=399ec374cb587bb2d2bc2081ee907c48c7a7b00f;hb=00ca0ad5370df5be4a0272364fb16a4385ffabfe;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..399ec37 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-2010 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: