respect the page when initializing the layout

geogolem 8 years ago
parent a2098a5797
commit bbb4880ba4

@ -12,6 +12,7 @@ var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout');
var FooterView = require('./MovieEditorFooterView'); var FooterView = require('./MovieEditorFooterView');
var GridPager = require('../../Shared/Grid/Pager'); var GridPager = require('../../Shared/Grid/Pager');
require('../../Mixins/backbone.signalr.mixin'); require('../../Mixins/backbone.signalr.mixin');
var Config = require('../../Config');
window.shownOnce = false; window.shownOnce = false;
module.exports = Marionette.Layout.extend({ module.exports = Marionette.Layout.extend({
@ -81,8 +82,10 @@ module.exports = Marionette.Layout.extend({
}, },
initialize : function() { initialize : function() {
this.movieCollection = MoviesCollection.clone(); this.movieCollection = MoviesCollection.clone();
var pageSize = parseInt(Config.getValue("pageSize")) || 10;
this.movieCollection.switchMode('client'); this.movieCollection.switchMode('client');
this.movieCollection.setPageSize(pageSize);
this.movieCollection.bindSignalR(); this.movieCollection.bindSignalR();
this.movieCollection.fullCollection.bindSignalR(); this.movieCollection.fullCollection.bindSignalR();

@ -24,6 +24,7 @@ var GridPager = require('../../Shared/Grid/Pager');
var FooterModel = require('./FooterModel'); var FooterModel = require('./FooterModel');
var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout'); var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout');
require('../../Mixins/backbone.signalr.mixin'); require('../../Mixins/backbone.signalr.mixin');
var Config = require('../../Config');
//var MoviesCollectionClient = require('../MoviesCollectionClient'); //var MoviesCollectionClient = require('../MoviesCollectionClient');
@ -139,8 +140,8 @@ module.exports = Marionette.Layout.extend({
//this variable prevents us from showing the list before seriesCollection has been fetched the first time //this variable prevents us from showing the list before seriesCollection has been fetched the first time
this.seriesCollection = MoviesCollection.clone(); this.seriesCollection = MoviesCollection.clone();
this.seriesCollection.bindSignalR(); this.seriesCollection.bindSignalR();
var pageSize = parseInt(Config.getValue("pageSize")) || 10;
this.seriesCollection.setPageSize(pageSize);
//this.listenTo(MoviesCollection, 'sync', function() { //this.listenTo(MoviesCollection, 'sync', function() {
// this.seriesCollection.fetch(); // this.seriesCollection.fetch();
//}); //});

Loading…
Cancel
Save