Closed einarq closed 13 years ago
Thanks for reminding me about the new Array methods on NodeList. Definitely worth mentioning.
You're probably right about ._nodes
vs. NodeList.getDOMNodes()
from the standpoint that the Rosetta Stone should only recommend best practices.
My personal stance is that ._nodes
should just be made (officially) public. It's extremely unlikely that it's going to need to change for any reason in the 3.x code line, and NodeList.getDOMNodes()
is just unnecessary overhead for getting to ._nodes
. We'll see what happens.
YUI: Update various examples to use the new 3.3.0 NodeList array methods. [Closed by 849e4b115857e84ce5e54c1f1d3e2050cb12222a]
That was fast! Exellent, thanks.
I agree that ._nodes
(and ._node
) is probably used a lot and hence might as well be made public. The irony is that if they were ever made public, they should not have the _
prefix, and hence all the code that uses those properties would have to be updated. Unless you keep the name of course, but that would probably be a bit confusing with regards to naming standards.
Perhaps you could add a dom()
method (or some other name) for more easy access to the underlying dom nodes in a Node or NodeList?
YUI 3.3 added the Array 1.5 methods to NodeList, such as concat. This should probably be mentioned. Also I think you should probably recommend using Y.NodeList.getDomNodes instead of the private ._nodes property, but that is just my personal opinion...