forked from extern/egroupware
Handle onchange in the same way as onclick - check if it's a real function first
This commit is contained in:
parent
791bf29e60
commit
b6ea2635d2
@ -125,7 +125,16 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener],
|
||||
|
||||
if (valid && this.onchange)
|
||||
{
|
||||
return et2_compileLegacyJS(this.onchange, this, _node)();
|
||||
if(typeof this.onchange == 'function')
|
||||
{
|
||||
// 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.onchange.apply(this, args);
|
||||
} else {
|
||||
return (et2_compileLegacyJS(this.options.onchange, this, _node))();
|
||||
}
|
||||
}
|
||||
return valid;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user