diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0107dd8641d..5729b87cc6f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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"); } } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 90cc6b420f8..fc4fafc60af 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -887,6 +887,9 @@ textarea.centpercent { .cursornotallowed { cursor: not-allowed; } +.cursorwait { + cursor: wait; +} .backgroundblank { background-color: #fff; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f1c314426a2..7521172121f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1032,6 +1032,9 @@ textarea.centpercent { .cursormove { cursor: move; } +.cursorwait { + cursor: wait; +} .cursornotallowed { cursor: not-allowed; }