Revert to old $.fn.add() behaviour, but provide a $.fn.sort()
The backwards incompatible change to $.fn.add() in jQuery 1.4 is bugging me.
First of all, it's breaking some old code, and second of all it bugs me because I don't get *why* it was changed to return a source-order sorted collection.
Consider this bit of code:
- var newElm = elm.prevAll().add( elm.parent() ).eq(0);
In 1.3.2 and earlier `newElm == elm.prev()`, whereas as of version 1.4 `newElm == elm.parent()`.
Questions:
- Could someone help me understand why this change to `.add()` was a) beneficial and b) neccessary?
- Wouldn't it make sense to add a `$.fn.sort()` method (or `$.fn.order()` if you will) to perform this action more generally?
- Would it be too late to revert `.add()` back to its old first-in-first-out behaviour, and save us all the trouble of patching/reworking our old code?
respectfully,
--
Már