Merge pull request #993 from geogolem/develop

clean up the fetching on loading of MovieEditor and MovieIndex once a…
geogolem 8 years ago committed by GitHub
commit a2098a5797

@ -3,7 +3,7 @@ var Marionette = require('marionette');
var Backgrid = require('backgrid'); var Backgrid = require('backgrid');
var EmptyView = require('../Index/EmptyView'); var EmptyView = require('../Index/EmptyView');
var FullMovieCollection = require ('../FullMovieCollection'); var FullMovieCollection = require ('../FullMovieCollection');
var MoviesCollection = require('../MoviesCollectionClient'); var MoviesCollection = require('../MoviesCollection');
var MovieTitleCell = require('../../Cells/MovieTitleCell'); var MovieTitleCell = require('../../Cells/MovieTitleCell');
var DownloadedQualityCell = require('../../Cells/DownloadedQualityCell'); var DownloadedQualityCell = require('../../Cells/DownloadedQualityCell');
var ProfileCell = require('../../Cells/ProfileCell'); var ProfileCell = require('../../Cells/ProfileCell');
@ -81,7 +81,8 @@ module.exports = Marionette.Layout.extend({
}, },
initialize : function() { initialize : function() {
this.movieCollection = MoviesCollection; this.movieCollection = MoviesCollection.clone();
this.movieCollection.switchMode('client');
this.movieCollection.bindSignalR(); this.movieCollection.bindSignalR();
this.movieCollection.fullCollection.bindSignalR(); this.movieCollection.fullCollection.bindSignalR();
@ -94,6 +95,7 @@ module.exports = Marionette.Layout.extend({
this._showToolbar(); this._showToolbar();
this._showTable(); this._showTable();
this._showPager(); this._showPager();
window.shownOnce = true;
}); });
this.listenTo(this.movieCollection.fullCollection, 'sync', function() { this.listenTo(this.movieCollection.fullCollection, 'sync', function() {
@ -156,13 +158,13 @@ module.exports = Marionette.Layout.extend({
}, },
onRender : function() { onRender : function() {
this._showToolbar(); //this._showToolbar();
this._showTable(); //this._showTable();
this._showPager(); //this._showPager();
if (window.shownOnce){ //if (window.shownOnce){
this.movieCollection.fetch(); // this.movieCollection.fetch();
} //}
window.shownOnce = true; //window.shownOnce = true;
}, },
onClose : function() { onClose : function() {

@ -292,8 +292,9 @@ module.exports = Marionette.Layout.extend({
onShow : function() { onShow : function() {
this._showToolbar(); this._showToolbar();
this._fetchCollection(); //this._fetchCollection();
if (window.shownOnce) { if (window.shownOnce) {
this._fetchCollection();
this._showFooter(); this._showFooter();
} }
window.shownOnce = true; window.shownOnce = true;

@ -1,6 +0,0 @@
var movieCollection = require('./MoviesCollection');
var ClientCollection = movieCollection.clone();
ClientCollection.bindSignalR();
ClientCollection.switchMode('client'); //state.pageSize = 100000;
module.exports = ClientCollection;
Loading…
Cancel
Save