Fix modify cursor on submit after a confirmation.

This commit is contained in:
Laurent Destailleur 2022-09-15 11:53:52 +02:00
parent 2ac4103af8
commit e0f76fd8f9
3 changed files with 20 additions and 5 deletions

View File

@ -5152,6 +5152,7 @@ class Form
var options = "&token='.urlencode(newToken()).'"; var options = "&token='.urlencode(newToken()).'";
var inputok = '.json_encode($inputok).'; /* List of fields into form */ var inputok = '.json_encode($inputok).'; /* List of fields into form */
var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'"; var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
if (inputok.length > 0) { if (inputok.length > 0) {
$.each(inputok, function(i, inputname) { $.each(inputok, function(i, inputname) {
var more = ""; var more = "";
@ -5168,7 +5169,12 @@ class Form
}); });
} }
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options; var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
if (pageyes.length > 0) { location.href = urljump; } if (pageyes.length > 0) {
// The call to urljump can be slow, so we set the wait cursor
jQuery("html,body,#id-container").addClass("cursorwait");
location.href = urljump;
console.log("after location.href");
}
$(this).dialog("close"); $(this).dialog("close");
}, },
"'.dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() { "'.dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
@ -5186,7 +5192,10 @@ class Form
} }
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options; var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
//alert(urljump); //alert(urljump);
if (pageno.length > 0) { location.href = urljump; } if (pageno.length > 0) {
location.href = urljump;
console.log("after location.href");
}
$(this).dialog("close"); $(this).dialog("close");
} }
} }

View File

@ -887,6 +887,9 @@ textarea.centpercent {
.cursornotallowed { .cursornotallowed {
cursor: not-allowed; cursor: not-allowed;
} }
.cursorwait {
cursor: wait;
}
.backgroundblank { .backgroundblank {
background-color: #fff; background-color: #fff;
} }

View File

@ -1032,6 +1032,9 @@ textarea.centpercent {
.cursormove { .cursormove {
cursor: move; cursor: move;
} }
.cursorwait {
cursor: wait;
}
.cursornotallowed { .cursornotallowed {
cursor: not-allowed; cursor: not-allowed;
} }