mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
reverting change to original egw_json.js as it somehow needs to assign return value to some context to work
This commit is contained in:
parent
34a2f8c6e0
commit
6577e30111
@ -461,31 +461,37 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe
|
||||
throw 'Invalid parameters';
|
||||
break;
|
||||
case 'apply':
|
||||
if (typeof res.data.func == 'string')
|
||||
if (typeof res.data.func == 'string' && typeof window[res.data.func] == 'function')
|
||||
{
|
||||
var parts = res.data.func.split('.');
|
||||
var func = parts.pop();
|
||||
var parent = window;
|
||||
for(var i=0; i < parts.length && typeof parent[parts[i]] != 'undefined'; ++i)
|
||||
try
|
||||
{
|
||||
parent = parent[parts[i]];
|
||||
window[res.data.func].apply(window, res.data.parms);
|
||||
}
|
||||
if (typeof parent[func] == 'function')
|
||||
catch (e)
|
||||
{
|
||||
_egw_json_debug_log(e, {'Function': res.data.func, 'Parameters': res.data.parms});
|
||||
}
|
||||
hasResponse = true;
|
||||
} else if (typeof res.data.func == "string" &&
|
||||
res.data.func.substr(0,4) == "app." && window.app)
|
||||
{
|
||||
|
||||
var parts = res.data.func.split(".");
|
||||
if(parts.length == 3 && typeof window.app[parts[1]] == "object" &&
|
||||
typeof window.app[parts[1]][parts[2]] == "function")
|
||||
{
|
||||
try
|
||||
{
|
||||
parent[func].apply(parent, res.data.parms);
|
||||
this.context = window.app[parts[1]][parts[2]].apply(window.app[parts[1]], res.data.parms);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
_egw_json_debug_log(e, {'Function': res.data.func, 'Parameters': res.data.parms});
|
||||
}
|
||||
hasResponse = true;
|
||||
}
|
||||
else
|
||||
throw 'Invalid parameters';
|
||||
}
|
||||
else
|
||||
hasResponse = true;
|
||||
|
||||
} else
|
||||
throw 'Invalid parameters';
|
||||
break;
|
||||
case 'jquery':
|
||||
|
Loading…
Reference in New Issue
Block a user