This mixin, when applied to an Ember.ContainerView
(and, by extension, a CollectionView
) creates three new methods on the extended view. These methods are called whenever a contained view raises a willInsertElement
, didInsertElement
or willDestroyElement
event.
HauteLook.ChildViewObserver = Ember.Mixin.create({
childViewsWillChange: function(childViews, start, removeCount, addCount) {
this._super.apply(this, arguments);
for(var i=0; i < removeCount; i++) {
var cv = childViews.objectAt(start + i);
cv.off('willInsertElement', this, this.willInsertChildElement);
cv.off('didInsertElement', this, this.didInsertChildElement);