Merge pull request #993 from geogolem/develop

clean up the fetching on loading of MovieEditor and MovieIndex once a…
This commit is contained in:
geogolem 2017-03-03 09:30:42 -05:00 committed by GitHub
commit a2098a5797
3 changed files with 13 additions and 16 deletions

View File

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

View File

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

View File

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