mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 09:58:04 +02:00
Get legacy JS parser to understand functions that don't start with "app." and don't have brackets in the attribute.
This covers widget or other non-app static functions (eg: et2_avatar.uploadAvatar_onFinish)
This commit is contained in:
parent
b7ec2a9b91
commit
eaafd5eb1f
@ -123,6 +123,28 @@
|
|||||||
context = _widget.getDOMNode();
|
context = _widget.getDOMNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check to see if it's referring to an existing function with no arguments specified.
|
||||||
|
// If so, bind context & use it directly
|
||||||
|
var parts = _code.split(".");
|
||||||
|
var existing_func = parts.pop();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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
|
||||||
try {
|
try {
|
||||||
|
@ -481,9 +481,6 @@ var et2_file = /** @class */ (function (_super) {
|
|||||||
if (typeof this.onFinishOne == 'function') {
|
if (typeof this.onFinishOne == 'function') {
|
||||||
this.onFinishOne(event, response, name);
|
this.onFinishOne(event, response, name);
|
||||||
}
|
}
|
||||||
else if (this.options.onFinishOne) {
|
|
||||||
et2_call(this.options.onFinishOne, event, response, name);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
@ -665,14 +665,10 @@ export class et2_file extends et2_inputWidget
|
|||||||
event.data = this;
|
event.data = this;
|
||||||
|
|
||||||
// Callback
|
// Callback
|
||||||
if(typeof this.onFinishOne == 'function' && !this.options.onFinishOne)
|
if(typeof this.onFinishOne == 'function')
|
||||||
{
|
{
|
||||||
this.onFinishOne(event, response, name);
|
this.onFinishOne(event, response, name);
|
||||||
}
|
}
|
||||||
else if (this.options.onFinishOne)
|
|
||||||
{
|
|
||||||
et2_call(this.options.onFinishOne,event,response,name);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user