Merge pull request #994 from geogolem/respectPageSizeWithoutReloading

respect the pageSize when initializing the layout
geogolem 8 years ago committed by GitHub
commit 3f05ef810e

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

@ -24,6 +24,7 @@ var GridPager = require('../../Shared/Grid/Pager');
var FooterModel = require('./FooterModel');
var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout');
require('../../Mixins/backbone.signalr.mixin');
var Config = require('../../Config');
//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.seriesCollection = MoviesCollection.clone();
this.seriesCollection.bindSignalR();
var pageSize = parseInt(Config.getValue("pageSize")) || 10;
this.seriesCollection.setPageSize(pageSize);
//this.listenTo(MoviesCollection, 'sync', function() {
// this.seriesCollection.fetch();
//});

Loading…
Cancel
Save