mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
Portal: Improve callback calls in CombodoPortalToolbox
This commit is contained in:
@@ -187,14 +187,28 @@ var CombodoPortalToolbox = {
|
||||
// Call callback on success
|
||||
if(callbackOnSuccess !== undefined)
|
||||
{
|
||||
window[callbackOnSuccess](oResponse);
|
||||
if(typeof callbackOnSuccess === 'string')
|
||||
{
|
||||
window[callbackOnSuccess](oResponse);
|
||||
}
|
||||
else if(typeof callbackOnSuccess === 'function')
|
||||
{
|
||||
callbackOnSuccess(oResponse);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Call callback while waiting for response
|
||||
if(callbackOnPending !== undefined)
|
||||
{
|
||||
window[callbackOnPending]();
|
||||
if(typeof callbackOnPending === 'string')
|
||||
{
|
||||
window[callbackOnPending](oResponse);
|
||||
}
|
||||
else if(typeof callbackOnPending === 'function')
|
||||
{
|
||||
callbackOnPending(oResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user