Display AJAX loader favicon only on blur
This commit is contained in:
parent
c41c101aa3
commit
c708fa1c69
|
@ -280,7 +280,9 @@ var ajaxState = 0;
|
||||||
*/
|
*/
|
||||||
function ajaxSend(url, data, popState) {
|
function ajaxSend(url, data, popState) {
|
||||||
var currentState = ++ajaxState;
|
var currentState = ++ajaxState;
|
||||||
|
onblur = function () {
|
||||||
replaceFavicon('../adminer/static/loader.gif');
|
replaceFavicon('../adminer/static/loader.gif');
|
||||||
|
};
|
||||||
setHtml('loader', '<img src="../adminer/static/loader.gif" alt="">');
|
setHtml('loader', '<img src="../adminer/static/loader.gif" alt="">');
|
||||||
return ajax(url, function (xmlhttp) {
|
return ajax(url, function (xmlhttp) {
|
||||||
if (currentState == ajaxState) {
|
if (currentState == ajaxState) {
|
||||||
|
@ -295,6 +297,7 @@ function ajaxSend(url, data, popState) {
|
||||||
}
|
}
|
||||||
return ajaxSend(redirect);
|
return ajaxSend(redirect);
|
||||||
}
|
}
|
||||||
|
onblur = function () { };
|
||||||
replaceFavicon('../adminer/static/favicon.ico');
|
replaceFavicon('../adminer/static/favicon.ico');
|
||||||
if (!xmlhttp.status) {
|
if (!xmlhttp.status) {
|
||||||
setHtml('loader', '');
|
setHtml('loader', '');
|
||||||
|
@ -355,7 +358,7 @@ function ajaxMain(url, data, event) {
|
||||||
/** Revive page from history
|
/** Revive page from history
|
||||||
* @param PopStateEvent|history
|
* @param PopStateEvent|history
|
||||||
*/
|
*/
|
||||||
window.onpopstate = function (event) {
|
onpopstate = function (event) {
|
||||||
ajaxSend(location.href, event.state, 1); // 1 - disable pushState
|
ajaxSend(location.href, event.state, 1); // 1 - disable pushState
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue