Commit 13e65b74 authored by Ryan Eastridge's avatar Ryan Eastridge

update thorax

parent 561b501e
...@@ -1107,14 +1107,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({ ...@@ -1107,14 +1107,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
} else { } else {
//use last() as appendItem can accept multiple nodes from a template //use last() as appendItem can accept multiple nodes from a template
var last = this.$el.find('[' + modelCidAttributeName + '="' + previousModel.cid + '"]').last(); var last = this.$el.find('[' + modelCidAttributeName + '="' + previousModel.cid + '"]').last();
if (last.length) { last.after(itemElement);
last.after(itemElement);
} else {
//TODO: this is a hack to make item filtering work since the previous
//query may not find an element if it was filtered, should re-write
//filtering and tests to use hide/show
this.$el.prepend(itemElement);
}
} }
this._appendViews(null, function(el) { this._appendViews(null, function(el) {
el.setAttribute(modelCidAttributeName, model.cid); el.setAttribute(modelCidAttributeName, model.cid);
...@@ -1125,6 +1118,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({ ...@@ -1125,6 +1118,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
if (!options.silent) { if (!options.silent) {
this.parent.trigger('rendered:item', this, this.collection, model, itemElement, index); this.parent.trigger('rendered:item', this, this.collection, model, itemElement, index);
} }
applyItemVisiblityFilter.call(this, model);
} }
return itemView; return itemView;
}, },
...@@ -1162,6 +1156,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({ ...@@ -1162,6 +1156,7 @@ Thorax.CollectionView = Thorax.HelperView.extend({
}, this); }, this);
} }
this.parent.trigger('rendered:collection', this, this.collection); this.parent.trigger('rendered:collection', this, this.collection);
applyVisibilityFilter.call(this);
} }
++this._renderCount; ++this._renderCount;
}, },
...@@ -1324,7 +1319,6 @@ Thorax.View.on({ ...@@ -1324,7 +1319,6 @@ Thorax.View.on({
if (collectionView.$el.length) { if (collectionView.$el.length) {
var index = collection.indexOf(model); var index = collection.indexOf(model);
collectionView.appendItem(model, index); collectionView.appendItem(model, index);
applyItemVisiblityFilter.call(collectionView, model);
} }
}, },
remove: function(collectionView, model, collection) { remove: function(collectionView, model, collection) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment