[Proto-Scripty] Re: Adding methods to Elements of a certain class.

2009-01-23 Thread Richard Quadling
2009/1/23 Richard Quadling rquadl...@googlemail.com: Hi. Should I add the method using (A)... $$('.css').invoke('addMethod', function(el, args){ // Payload }); Or should I use (B) ... Element.addMethods(function(el, args) { if (el.hasClass('css')) { // Payload } });

[Proto-Scripty] Re: Adding methods to Elements of a certain class.

2009-01-23 Thread kangax
On Jan 23, 10:29 am, Richard Quadling rquadl...@googlemail.com wrote: 2009/1/23 Richard Quadling rquadl...@googlemail.com: [...] This works ... $$('.tabC').each(       function(el)    {         el.addSheet = addSheet.methodize(); }); I wouldn't suggest doing this. You are burdening all