fix the footer to show correct information and refresh when FullCollection changes (#893)

pull/2/head
geogolem 8 years ago committed by Devin Buhl
parent 997dce288d
commit 55ac2dd1bb

@ -122,9 +122,13 @@ module.exports = Marionette.Layout.extend({
initialize : function() {
this.seriesCollection = MoviesCollection.clone();
this.seriesCollection.bindSignalR();
this.fullCollection = FullMovieCollection;
//this.fullCollection = FullMovieCollection;
//need to add this so the footer gets refreshed
this.listenTo(FullMovieCollection, 'sync', function(model, collection, options) {
//this._renderView();
this._showFooter();
});
this.listenTo(this.seriesCollection, 'sync', function(model, collection, options) {
//this.seriesCollection.fullCollection.resetFiltered();
@ -310,7 +314,7 @@ module.exports = Marionette.Layout.extend({
//debugger;
});
this._showToolbar();
this._showFooter();
//this._showFooter();
}
},
@ -362,7 +366,10 @@ module.exports = Marionette.Layout.extend({
_showFooter : function() {
var footerModel = new FooterModel();
var movies = MoviesCollection.models.length;
var movies = FullMovieCollection.models.length;
//instead of all the counters could do something like this with different query in the where...
//var releasedMovies = FullMovieCollection.where({ 'released' : this.model.get('released') });
// releasedMovies.length
var announced = 0;
var incinemas = 0;
@ -378,7 +385,7 @@ module.exports = Marionette.Layout.extend({
var downloadedNotMonitored=0;
_.each(MoviesCollection.models, function(model) {
_.each(FullMovieCollection.models, function(model) {
if (model.get('status').toLowerCase() === 'released') {
released++;

Loading…
Cancel
Save