mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-14 18:08:21 +01:00
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
@ -122,10 +122,19 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener],
|
||||
|
||||
// Passing false will clear any set messages
|
||||
this.set_validation_error(valid ? false : messages);
|
||||
|
||||
|
||||
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