mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
N°3786 - Fix lock removal when leaving an object details page in edition
The main problem was WebPage::$a_scripts are now printed after the DOM when the mechanism actually prints some JS to redirect to another page immediately. As there are a LOT of calls to WebPage::add_script(), we kept it to ensure the compatibility; and we add a new WebPage::add_early_script() for JS snippets that explicitly need to be execute before the DOM interpretation.
This commit is contained in:
@@ -115,11 +115,10 @@ 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: true,
|
||||
async: false,
|
||||
method: 'POST',
|
||||
data: {operation: 'on_form_cancel', transaction_id: sTransactionId, obj_class: sObjClass, obj_key: iObjKey, token: sToken }
|
||||
});
|
||||
CombodoGlobalToolbox.Pause(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user