Added external library NProgress and ajax-timeouts

This commit is contained in:
2019-06-19 13:27:00 +00:00
parent dca8f74f25
commit ba6b6f277a
3 changed files with 10 additions and 33 deletions

View File

@ -40,25 +40,27 @@ $(document).ready(function(){
xhrFields: {
withCredentials: true,
},
timeout: 750,
// origin domain should be exempted from timeout
// (because origin domain can/will be different from current domain --due to traefik design).
data: {
ref: btoa(JSON.stringify({
action: 'login',
token: data.SecureToken
}))
}
}).done(function() {
NProgress.inc(1 / XHR.length);
}));
});
$.when.apply($, XHR).then(function(){
$.each(arguments, function(_index, _arg) {
// Show progress somehow (maybe something like https://minicss.org/v2/progress)
// Finished cross-domain logins (either succesfully or through timeout)
NProgress.done();
window.location.replace(data.Location);
});
});
}
// Finished (either succesfully or through timeout) cross-domain logins
// redirect once all finished loading or timeout after $X ms
// origin domain should be exempted from timeout
// (because origin domain can/will be different from current domain --due to traefik design).
//window.location.replace(data.Location);
}, 2250);
} else {
$('#btnlogin').css({