mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
instanciate app.js object, if not yet done
This commit is contained in:
parent
3a5ece79a7
commit
65c3f50923
@ -753,8 +753,8 @@ function et2_rangeSubstract(_ar1, _ar2)
|
|||||||
/**
|
/**
|
||||||
* Call a function specified by it's name (possibly dot separated, eg. "app.myapp.myfunc")
|
* Call a function specified by it's name (possibly dot separated, eg. "app.myapp.myfunc")
|
||||||
*
|
*
|
||||||
* @param string func dot-separated function name
|
* @param {string} _func dot-separated function name
|
||||||
* @param arguments variable number of arguments
|
* variable number of arguments
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
function et2_call(_func)
|
function et2_call(_func)
|
||||||
@ -767,9 +767,17 @@ function et2_call(_func)
|
|||||||
{
|
{
|
||||||
var parts = _func.split('.');
|
var parts = _func.split('.');
|
||||||
func = parts.pop();
|
func = parts.pop();
|
||||||
for(var i=0; i < parts.length && typeof parent[parts[i]] != 'undefined'; ++i)
|
for(var i=0; i < parts.length; ++i)
|
||||||
{
|
{
|
||||||
parent = parent[parts[i]];
|
if (typeof parent[parts[i]] != 'undefined')
|
||||||
|
{
|
||||||
|
parent = parent[parts[i]];
|
||||||
|
}
|
||||||
|
// check if we need a not yet instanciated app.js object --> instanciate it now
|
||||||
|
else if (i == 1 && parts[0] == 'app' && typeof window.app.classes[parts[1]] == 'function')
|
||||||
|
{
|
||||||
|
parent = parent[parts[1]] = new window.app.classes[parts[1]]();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (typeof parent[func] == 'function')
|
if (typeof parent[func] == 'function')
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user