From 20db8b6db883ccdd3b51efd584311fa909f2e1e0 Mon Sep 17 00:00:00 2001 From: jfarcand Date: Fri, 27 Apr 2012 08:37:17 -0400 Subject: [PATCH] Fix for #309 [atmosphere.js] Reconnect function must always be invoked before reconnect --- modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js b/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js index b926b75fbf9..d45a8730f34 100644 --- a/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js +++ b/modules/jquery/src/main/webapp/jquery/jquery.atmosphere.js @@ -969,7 +969,7 @@ jQuery.atmosphere = function() { } if (!rq.executeCallbackBeforeReconnect) { - _invokeCallback(); + _open('re-opening', rq.transport); _reconnect(ajaxRequest, rq, false); } @@ -977,9 +977,10 @@ jQuery.atmosphere = function() { if (_response.responseBody.indexOf("parent.callback") != -1) { jQuery.atmosphere.log(rq.logLevel, ["parent.callback no longer supported with 0.8 version and up. Please upgrade"]); } + _invokeCallback(); if (rq.executeCallbackBeforeReconnect) { - _invokeCallback(); + _open('re-opening', rq.transport); _reconnect(ajaxRequest, rq, false); } @@ -987,8 +988,6 @@ jQuery.atmosphere = function() { // Close and reopen connection on large data received ajaxRequest.abort(); _doRequest(ajaxRequest, rq, true); - } else { - _open('re-opening', rq.transport); } } };