I haven''t been able to find any discussion about this. It looks as if
Selector.matchElements is broken (which means that
Selector.findElement, Element.down(elt, cssselector) dont work
properly.
What I''m seeing is that (line 3310) the Selector.findElements is not
called with the root node of the node you are wishing to find elements
under (its not called with a parameter at all) - so down the call
stack, the xpath is applied against the root document (which probably
doesn''t have the elements you intended).
You''re already passed the elements array of the descendants, so it
seems logical to do the following instead:
matchElements: function(elements, expression) {
selector = new Selector(expression);
for (var i=0, results = [], element; element = elements[i]; i++) {
if (selector.match(element)) {
results.push(element);
}
}
return results;
},
This seems to make Element.down(elt, classname) work properly - but
I''m not well versed on how many other areas probably use this, being
my first real Prototype issue.
Let me know if this makes sense... this is a function I don''t
immediately need because I can use the element index instead, but I
thought it might be useful.
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---