On Dec 22, 2007 1:41 AM, kangax <[EMAIL PROTECTED]> wrote:
>
> In a nutshell, supporting something like this could lead to
> unnecessary complications in prototype's source.
> See this post for more info:
> http://groups.google.com/group/prototype-core/browse_thread/thread/6678c73903a41df/f8be89fc29d07e2e
Yeah, I remember :) I meant that you *can't* do that kind of selections.
Fabio, I was thinking something on the lines of
String.prototype.match = String.prototype.match.wrap(function(proceed, obj) {
if (Object.isElement(obj)) return new Selector(this).match(obj);
return proceed(obj);
});
And then you can do element.immediateDescendants().grep("#some .selector");
Even more, alias immediateDescendants as children and then it's
element.children().grep("#some .selector"); which is a little nicer
(and concise) IMO.
-Nicolas
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---