mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-14 18:08:21 +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});
|
_egw_json_debug_log(e, {'Function': res.data.func, 'Parameters': res.data.parms});
|
||||||
}
|
}
|
||||||
hasResponse = true;
|
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
|
} else
|
||||||
throw 'Invalid parameters';
|
throw 'Invalid parameters';
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user