mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-25 15:29:17 +01:00
Make sure onclick callback functions (specified as app.appname.funcname, or a real function) get all parameters passed, and they always can have a reference to the responsible widget
This commit is contained in:
parent
ae848ffaee
commit
b7ad0d33f8
@ -238,7 +238,11 @@ var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned,
|
|||||||
{
|
{
|
||||||
if(typeof this.onclick == 'function')
|
if(typeof this.onclick == 'function')
|
||||||
{
|
{
|
||||||
return this.onclick(_node);
|
// Make sure function gets a reference to the widget
|
||||||
|
var args = Array.prototype.slice.call(arguments);
|
||||||
|
if(args.indexOf(this) == -1) args.push(this);
|
||||||
|
|
||||||
|
return this.onclick.apply(this, args);
|
||||||
} else {
|
} else {
|
||||||
return (et2_compileLegacyJS(this.options.onclick, this, _node))();
|
return (et2_compileLegacyJS(this.options.onclick, this, _node))();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user