From e15953524a6612d9d6b2d992438eb8f88ba27822 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 16 Jul 2021 20:02:04 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03786=20-=20Add=20pause=20at=20the=20end?= =?UTF-8?q?=20of=20the=20page=20unload=20async=20request=20to=20follow=20t?= =?UTF-8?q?he=20guideline=20used=20in=20N=C2=B02763?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/forms-json-utils.js | 3 ++- js/utils.js | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/js/forms-json-utils.js b/js/forms-json-utils.js index 23b897689..d3e06f436 100644 --- a/js/forms-json-utils.js +++ b/js/forms-json-utils.js @@ -115,10 +115,11 @@ function OnUnload(sTransactionId, sObjClass, iObjKey, sToken) // IMPORTANT: the ajax request MUST BE synchronous to be executed in this context $.ajax({ url: GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', - async: false, + async: true, method: 'POST', data: {operation: 'on_form_cancel', transaction_id: sTransactionId, obj_class: sObjClass, obj_key: iObjKey, token: sToken } }); + CombodoGlobalToolbox.Pause(1000); } } diff --git a/js/utils.js b/js/utils.js index a9fc950e9..ce2bfd132 100644 --- a/js/utils.js +++ b/js/utils.js @@ -725,6 +725,23 @@ const CombodoGlobalToolbox = { sOutput = sOutput.replace(/