mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
Make sure there are no parameters before trying nice check for function name
This commit is contained in:
parent
878dc659b1
commit
5a1f642ce2
@ -125,25 +125,24 @@
|
|||||||
|
|
||||||
// Check to see if it's referring to an existing function with no arguments specified.
|
// Check to see if it's referring to an existing function with no arguments specified.
|
||||||
// If so, bind context & use it directly
|
// If so, bind context & use it directly
|
||||||
var parts = _code.split(".");
|
if(_code.indexOf("(") === -1)
|
||||||
var existing_func = parts.pop();
|
|
||||||
var parent = _widget.egw().window;
|
|
||||||
for(var i=0; i < parts.length; ++i)
|
|
||||||
{
|
{
|
||||||
if (typeof parent[parts[i]] !== "undefined")
|
var parts = _code.split(".");
|
||||||
{
|
var existing_func = parts.pop();
|
||||||
parent = parent[parts[i]];
|
var parent = _widget.egw().window;
|
||||||
|
for (var i = 0; i < parts.length; ++i) {
|
||||||
|
if (typeof parent[parts[i]] !== "undefined") {
|
||||||
|
parent = parent[parts[i]];
|
||||||
|
}
|
||||||
|
// Nope
|
||||||
|
else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Nope
|
if (typeof parent[existing_func] === "function") {
|
||||||
else
|
return parent[existing_func].bind(context);
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeof parent[existing_func] === "function")
|
|
||||||
{
|
|
||||||
return parent[existing_func].bind(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generate the function itself, if it fails, log the error message and
|
// Generate the function itself, if it fails, log the error message and
|
||||||
// return a function which always returns false
|
// return a function which always returns false
|
||||||
|
Loading…
Reference in New Issue
Block a user