mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 00:58:55 +01:00
allow for objectified egw functions like app.APPLICATION.
This commit is contained in:
parent
cd25f3e625
commit
91dc1f9df9
@ -472,6 +472,25 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe
|
||||
_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
|
||||
{
|
||||
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';
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user