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
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;
/* 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;
function doLogout(noredirect) {
/* cancel everything else */
- cleanRemoteRequests();
+ abortAllRequests();
/* be nice and delete the session from the server */
if(G.user && G.user.session) {