When passing an Elements array via the options to a class, all of the
Element functions get lost. Only an array of Elements is kept.
Apparently, the setOptions() function has this side effect on Elements
arrays.
As a workaround, running that array again through a new Elements()
constructor got me back on my feet.
var Test = new Class({
Implements:Options,
options: {
//els: $$('xxx')
},
initialize: function(options){
this.setOptions(options);
console.log(options.els.addEvent); //>> function
console.log(this.options.els.addEvent); //>> undefined !!!
console.log(new Elements(this.options.els).addEvent); //>>
function
(ok workaround)
}
})
new Test({ els:$$('a.tool') });
Is this intentional ? I could not find anything documented on this.