Fixing [Bug 1427] (Better than just uncommenting :-) )
authorjulmis <julmis>
Sat, 22 May 2004 17:58:14 +0000 (17:58 +0000)
committerjulmis <julmis>
Sat, 22 May 2004 17:58:14 +0000 (17:58 +0000)
lib/editor/popups/fullscreen.php

index 7755d9401b3e44c99222a57311dbf27f82f96766..c4180ca4e726177edcf2a3ac472ad46a4fbfb592 100644 (file)
@@ -44,15 +44,17 @@ var editor         = null;      // to be initialized later [ function init() ]
 \* ---------------------------------------------------------------------- */
 
 function _CloseOnEsc(ev) {
-  if (document.all) {
-    // IE
-    ev = window.event;
-  }
-  if (ev.keyCode == 27) {
-    // update_parent();
-    window.close();
-    return;
-  }
+    try {
+        if (document.all) {
+            // IE
+            ev || (ev = editor._iframe.contentWindow.event);
+        }
+        if (ev.keyCode == 27) {
+            // update_parent();
+            window.close();
+            return;
+        }
+    } catch(e) {}
 }
 
 /* ---------------------------------------------------------------------- *\