mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Improve load behavior of ajaxpending.js
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<script type="text/javascript" src="{% static "pretixbase/js/ajaxpending.js" %}"></script>
|
||||
{% endcompress %}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="refresh" content="1">
|
||||
<meta http-equiv="refresh" content="10">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
window.setInterval(function () {
|
||||
$.get(location.href + '?ajax=1', function (data, status) {
|
||||
if (data === "1") {
|
||||
location.reload();
|
||||
var check = function () {
|
||||
$.getJSON(location.href + '&ajax=1', function (data, status) {
|
||||
if (data.redirect) {
|
||||
location.href = data.redirect;
|
||||
} else {
|
||||
window.setTimeout(check, 500);
|
||||
}
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
window.setTimeout(check, 500);
|
||||
|
||||
Reference in New Issue
Block a user