From 7f0cca96e9f74f7f473d59beeb1eeb37c094c73c Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 3 Mar 2006 03:16:15 +0000 Subject: [PATCH] added abortAllRequests which does just that. cleanRemoteRequests now does not call abort because it seems to make page navigation take longer (since the browser just aborts them anyway when going to a new page). git-svn-id: svn://svn.open-ils.org/ILS/trunk@3243 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/common/js/RemoteRequest.js | 17 ++++++++++++++--- Open-ILS/web/opac/common/js/opac_utils.js | 4 ++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Open-ILS/web/opac/common/js/RemoteRequest.js b/Open-ILS/web/opac/common/js/RemoteRequest.js index 6126f38db4..3734450bf0 100644 --- a/Open-ILS/web/opac/common/js/RemoteRequest.js +++ b/Open-ILS/web/opac/common/js/RemoteRequest.js @@ -23,14 +23,25 @@ function cleanRemoteRequests() { destroyRequest(_allrequests[i]); } +function abortAllRequests() { + for( var i in _allrequests ) { + var r = _allrequests[i]; + if(r) { + /* this has to come before abort() or IE will puke on you */ + r.xmlhttp.onreadystatechange = function(){}; + r.abort(); + destroyRequest(r); + } + } +} + function destroyRequest(r) { if(r == null) return; if( r.xmlhttp ) { - /* this has to come before abort() or IE will puke on you */ r.xmlhttp.onreadystatechange = function(){}; - r.abort(); - r.xmlhttp = null; + //r.abort(); + r.xmlhttp = null; } r.callback = null; diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js index 6260bef674..bff12a11db 100644 --- a/Open-ILS/web/opac/common/js/opac_utils.js +++ b/Open-ILS/web/opac/common/js/opac_utils.js @@ -424,7 +424,7 @@ function grabSkinFromURL() { /* returns a fleshed G.user on success, false on failure */ function doLogin() { - cleanRemoteRequests(); /* cancel whatever is out there */ + abortAllRequests(); var uname = G.ui.login.username.value; var passwd = G.ui.login.password.value; @@ -460,7 +460,7 @@ function doLogin() { function doLogout(noredirect) { /* cancel everything else */ - cleanRemoteRequests(); + abortAllRequests(); /* be nice and delete the session from the server */ if(G.user && G.user.session) { -- 2.43.2