On Thu, Jun 19, 2008 at 4:56 PM, kangax <[EMAIL PROTECTED]> wrote:
>
> Dan,
> not sure what Array#match is, but #grep could do this nicely : )
>
> $(someElement).siblings().grep(new Selector('.someClass'));

Yep, I'm not sure what I was smoking exactly, but I think it had some
jQuery in it :)

By way of penance, some extra credit work. Louis, If you find yourself
needing this functionality a lot, you could always augment the
behavior of siblings using Function.wrap:

Element.addMethods({
  siblings: Element.siblings.wrap(function(proceed, element, selector) {
    var sibs = proceed.call(this, element);
      return selector ?
        sibs.grep(selector instanceof Selector ?
          selector :
          new Selector(selector)) :
        sibs;
  })
});

:Dan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to