mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
trying another redirect method.
This commit is contained in:
parent
ed00696fde
commit
b7b32454d7
1 changed files with 4 additions and 3 deletions
|
@ -28,7 +28,7 @@ function do_success() {
|
||||||
console.log('success: '+url);
|
console.log('success: '+url);
|
||||||
|
|
||||||
// Do something like refresh the window or go to another URL.
|
// Do something like refresh the window or go to another URL.
|
||||||
location.replace(url);
|
window.location = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show an error to the user
|
// Show an error to the user
|
||||||
|
@ -127,7 +127,8 @@ function poll_jobs(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
do_success();
|
// Will hopefully try a redirect until it succeeds.
|
||||||
|
var timer = setInterval(do_success, 2000);
|
||||||
}
|
}
|
||||||
}, function(reason) {
|
}, function(reason) {
|
||||||
do_error(reason);
|
do_error(reason);
|
||||||
|
@ -152,7 +153,7 @@ $('#approveForm').submit(function (event) {
|
||||||
$('#approveButton').val('');
|
$('#approveButton').val('');
|
||||||
$('#approveButton').addClass('button-loading');
|
$('#approveButton').addClass('button-loading');
|
||||||
|
|
||||||
$('#approveButtonDiv').replaceWith('<img src="/static/images/radio.svg" alt="Loading, please wait..." />');
|
//$('#approveButtonDiv').replaceWith('<img src="/static/images/radio.svg" alt="Loading, please wait..." />');
|
||||||
|
|
||||||
var ajaxReq = $.post(api_url);
|
var ajaxReq = $.post(api_url);
|
||||||
ajaxReq.done(poll_jobs);
|
ajaxReq.done(poll_jobs);
|
||||||
|
|
Loading…
Reference in a new issue