From: Jakub Vrana Date: Tue, 15 Mar 2011 11:58:04 +0000 (+0100) Subject: Display AJAX loader favicon only on blur X-Git-Tag: v3.2.1~36 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=c708fa1c69c36a5378ff1599c58be9f99ede63d2;p=adminer.git Display AJAX loader favicon only on blur --- diff --git a/adminer/static/functions.js b/adminer/static/functions.js index f2654b36..11bb2066 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -280,7 +280,9 @@ var ajaxState = 0; */ function ajaxSend(url, data, popState) { var currentState = ++ajaxState; - replaceFavicon('../adminer/static/loader.gif'); + onblur = function () { + replaceFavicon('../adminer/static/loader.gif'); + }; setHtml('loader', ''); return ajax(url, function (xmlhttp) { if (currentState == ajaxState) { @@ -295,6 +297,7 @@ function ajaxSend(url, data, popState) { } return ajaxSend(redirect); } + onblur = function () { }; replaceFavicon('../adminer/static/favicon.ico'); if (!xmlhttp.status) { setHtml('loader', ''); @@ -355,7 +358,7 @@ function ajaxMain(url, data, event) { /** Revive page from history * @param PopStateEvent|history */ -window.onpopstate = function (event) { +onpopstate = function (event) { ajaxSend(location.href, event.state, 1); // 1 - disable pushState }