N°4352 - Fix unlock message

This commit is contained in:
Eric Espie
2021-10-12 08:55:40 +02:00
parent c7a7bfcd68
commit 836a35d0dd

View File

@@ -112,13 +112,14 @@ function OnUnload(sTransactionId, sObjClass, iObjKey, sToken)
if (!window.bInSubmit)
{
// If it's not a submit, then it's a "cancel" (Pressing the Cancel button, closing the window, using the back button...)
// IMPORTANT: the ajax request MUST BE synchronous to be executed in this context
$.ajax({
url: GetAbsoluteUrlAppRoot()+'pages/ajax.render.php',
async: false,
method: 'POST',
data: {operation: 'on_form_cancel', transaction_id: sTransactionId, obj_class: sObjClass, obj_key: iObjKey, token: sToken }
});
var sUrl = GetAbsoluteUrlAppRoot()+'pages/ajax.render.php';
var oFormData = new FormData();
oFormData.append('operation', 'on_form_cancel');
oFormData.append('transaction_id', sTransactionId);
oFormData.append('obj_class', sObjClass);
oFormData.append('obj_key', iObjKey);
oFormData.append('token', sToken);
navigator.sendBeacon(sUrl, oFormData);
}
}