2
0
forked from Wavyzz/dolibarr

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,7 +5152,8 @@ class Form
var options = "&token='.urlencode(newToken()).'";
var inputok = '.json_encode($inputok).'; /* List of fields into form */
var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
if (inputok.length>0) {
if (inputok.length > 0) {
$.each(inputok, function(i, inputname) {
var more = "";
var inputvalue;
@@ -5168,14 +5169,19 @@ class Form
});
}
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
if (pageyes.length > 0) { location.href = urljump; }
$(this).dialog("close");
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");
},
"'.dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
var options = "&token='.urlencode(newToken()).'";
var inputko = '.json_encode($inputko).'; /* List of fields into form */
var pageno="'.dol_escape_js(!empty($pageno) ? $pageno : '').'";
if (inputko.length>0) {
if (inputko.length > 0) {
$.each(inputko, function(i, inputname) {
var more = "";
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
@@ -5186,7 +5192,10 @@ class Form
}
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
//alert(urljump);
if (pageno.length > 0) { location.href = urljump; }
if (pageno.length > 0) {
location.href = urljump;
console.log("after location.href");
}
$(this).dialog("close");
}
}