1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-28 23:16:32 -04:00

Series detials fixes

Fixed: Adding a new series and going to series details will show data after information is fetched
Fixed: Series details won't reload view after update
This commit is contained in:
Mark McDowall
2014-11-06 07:34:15 -08:00
parent 48ec113598
commit b6fc490b89
6 changed files with 87 additions and 34 deletions
@@ -19,6 +19,27 @@ define(
this.series = options.series;
},
appendHtml: function(collectionView, itemView, index) {
var childrenContainer = collectionView.itemViewContainer ? collectionView.$(collectionView.itemViewContainer) : collectionView.$el;
var collection = collectionView.collection;
// If the index of the model is at the end of the collection append, else insert at proper index
if (index >= collection.size() - 1) {
childrenContainer.append(itemView.el);
} else {
var previousModel = collection.at(index + 1);
var previousView = this.children.findByModel(previousModel);
if (previousView) {
previousView.$el.before(itemView.$el);
}
else {
childrenContainer.append(itemView.el);
}
}
},
itemViewOptions: function () {
return {
episodeCollection: this.episodeCollection,