Adapts orangisation to master and PhD and merges it into the main profile edition.
[platal.git] / htdocs / javascript / close_on_esc.js
index b086c93..399ec37 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  *  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: