component/sort — pull request #2 by jb55 (2013-04-28 20:17:09+00:00)
Title: Don't assume el.children are the elements to sort, but use it as default

This commit is backwards compatible with the previous api.

It allows for a more generalized/advanced element sorting, like sorting grouped elements with document fragments (which was my use case)

```jade
table
tbody
tr.group1
td A
td B
td C
tr.group1
td(colspan=100) Details dropdown
tr.group2
// ...
tr.group2
// ...
```

This commit allows me to sort the table like so:

```js
var table = query('table')
var trs = query.all('tbody > tr', table);
var groups = _(trs).groupBy(function(tr) { return tr.className; });
var els = _(groups).map(function(trs, key){
var frag = document.createDocumentFragment();
_(trs).each(function(tr){
frag.appendChild(tr);
});
return frag;
});
sort(table, els, fn);
```

Let me know if this is worth including.

Cheers,
Bill