Thomas, I like your setEach implementation. Not sure if it goes in -core either, but if it were there, I'd use it. If it weren't in core, I probably would use it a lot less, as you can always just express this more explicitly with -core methods, and it's probably not worth a plugin when I need to do stuff like this.
That's probably your answer; it's neat, but the current way of doing this is not much more verbose or difficult. On Wed, Feb 3, 2010 at 5:15 AM, Thomas Aylott <[email protected]>wrote: > No point in doing it yourself. > $$ aka Elements is already a custom Array of elements. > > On Wednesday, February 3, 2010, Henrik Hansen <[email protected]> wrote: > > I've been working on something similar. > > It's called Array.expose. Let's say that you have an array of > > elements: > > > > a = [el1, el2, el3, ... , eln] > > > > and then call the method expose: > > > > a.expose('set') > > > > then the method Array.set would actually be Array.each(function(x) > > {x.set()}). > > Therefore I can then do this: > > > > a.set('html', 'hello') > > > > Adding some way of using Array.map instead of Array.each might also be > > interesting > > > > On Feb 3, 10:04 am, Thomas Aylott <[email protected]> wrote: > >> http://mootools.net/shell/nrKCz/2/ > >> > >> Was talking to rpflo about this on IRC. > >> > >> See #12 > http://net.tutsplus.com/tutorials/javascript-ajax/jquery-1-4-released... > >> > >> Just thought I'd share my final solution in case anyone thought it'd be > neat. > >> > >> Personally, I don't think this sort of thing is really needed in > MooTools core. > >> But maybe I'll make it a plugin if anyone likes it. > >> > >> — Thomas Aylott > >> SubtleGradient > >> MooTools > > > > -- > — Thomas Aylott > SubtleGradient > MooTools >
