emberjs/ember.js — pull request #1562 by twinturbo (2012-11-29 22:17:44+00:00)
Title: Ember.Arrangable mixin (SortableMixin + FilterableMixin)

This PR take commits from https://github.com/emberjs/ember.js/pull/1288 and combines that with the existing `SortableMixin`. This makes it easier to use both at the same time. It also should be more performant in the combined use case because it does not have to loop over the `content` array twice to add observers. The existing api from `Ember.SortableMixin` is mirrored for filtering. You can specify `filterProperties` the same as `sortProperties`.

There is one failing test ATM. The test is carried over from the `Ember.SortableMixin` tests which tests to see that a item is not reinserted if it's position does not change. I will address this issue.

I've pushed this code to say that I'm serious about this feature. This is a major pain point of us. I can't see why there can't be one single mixin to do this.

The original implementation is from @crofty. I've simply pulled his commits and refactored them so they can be merged with `Ember.SortableMixin`.