mirror of
https://github.com/vrana/adminer.git
synced 2025-08-15 19:13:59 +02:00
Clear AJAX loader in correct state only
This commit is contained in:
@@ -249,11 +249,7 @@ function ajax(url, callback, data) {
|
||||
if (title) {
|
||||
document.title = decodeURIComponent(title);
|
||||
}
|
||||
if (xmlhttp.status) {
|
||||
callback(xmlhttp.responseText);
|
||||
} else {
|
||||
setHtml('loader', '');
|
||||
}
|
||||
callback(xmlhttp.status ? xmlhttp.responseText : undefined);
|
||||
}
|
||||
};
|
||||
xmlhttp.send(data);
|
||||
@@ -287,10 +283,13 @@ function ajaxSend(url, data, popState) {
|
||||
setHtml('loader', '<img src="../adminer/static/loader.gif" alt="">');
|
||||
return ajax(url, function (text) {
|
||||
if (currentState == ajaxState) {
|
||||
if (text === undefined) {
|
||||
setHtml('loader', '');
|
||||
} else {
|
||||
if (!popState) {
|
||||
history.pushState(data, '', url);
|
||||
}
|
||||
scrollTo(0, 0);
|
||||
}
|
||||
setHtml('content', text);
|
||||
var content = document.getElementById('content');
|
||||
var scripts = content.getElementsByTagName('script');
|
||||
@@ -321,6 +320,7 @@ function ajaxSend(url, data, popState) {
|
||||
jush.highlight_tag('code', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, data);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user