Scroll to top with AJAX
This commit is contained in:
parent
ad279e1171
commit
ecc8166f08
|
@ -268,11 +268,13 @@ function ajaxSend(url, data) {
|
||||||
var currentState = ++ajaxState;
|
var currentState = ++ajaxState;
|
||||||
clearTimeout(ajaxTimeout);
|
clearTimeout(ajaxTimeout);
|
||||||
ajaxTimeout = setTimeout(function () {
|
ajaxTimeout = setTimeout(function () {
|
||||||
|
scrollTo(0, 0);
|
||||||
setHtml('content', '<img src="../adminer/static/loader.gif" alt="">');
|
setHtml('content', '<img src="../adminer/static/loader.gif" alt="">');
|
||||||
}, 500); // defer displaying loader
|
}, 500); // defer displaying loader
|
||||||
return ajax(url, function (text) {
|
return ajax(url, function (text) {
|
||||||
if (currentState == ajaxState) {
|
if (currentState == ajaxState) {
|
||||||
clearTimeout(ajaxTimeout);
|
clearTimeout(ajaxTimeout);
|
||||||
|
scrollTo(0, 0);
|
||||||
setHtml('content', text);
|
setHtml('content', text);
|
||||||
var content = document.getElementById('content');
|
var content = document.getElementById('content');
|
||||||
var scripts = content.getElementsByTagName('script');
|
var scripts = content.getElementsByTagName('script');
|
||||||
|
|
Loading…
Reference in a new issue