From fd0824d3e2ceff8ddae8d4c7f764e07cbb0715f5 Mon Sep 17 00:00:00 2001 From: Jeanfrancois Arcand Date: Mon, 27 Aug 2012 16:55:41 -0700 Subject: [PATCH] Fix for #569 [jQuery] firefox, ESC key closes request --- modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js b/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js index dbdf8ecf3aa..41e4d2c2baf 100644 --- a/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js +++ b/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js @@ -33,6 +33,13 @@ jQuery.atmosphere = function() { jQuery.atmosphere.unsubscribe(); }); + // Prevent ESC to kill the connection from Firefox. + jQuery(window).keypress(function(e){ + if(e.keyCode == 27){ + e.preventDefault(); + } + }); + var parseHeaders = function(headerString) { var match, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, headers = {}; while (match = rheaders.exec(headerString)) {