You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
778 B
25 lines
778 B
var _ = require('underscore');
|
|
var Marionette = require('marionette');
|
|
var UpcomingCollection = require('./UpcomingCollection');
|
|
var UpcomingItemView = require('./UpcomingItemView');
|
|
require('../Mixins/backbone.signalr.mixin');
|
|
|
|
module.exports = Marionette.CollectionView.extend({
|
|
itemView : UpcomingItemView,
|
|
|
|
initialize : function() {
|
|
this.collection = new UpcomingCollection().bindSignalR({ updateOnly : true });
|
|
this.collection.fetch();
|
|
|
|
this._fetchCollection = _.bind(this._fetchCollection, this);
|
|
this.timer = window.setInterval(this._fetchCollection, 60 * 60 * 1000);
|
|
},
|
|
|
|
onClose : function() {
|
|
window.clearInterval(this.timer);
|
|
},
|
|
|
|
_fetchCollection : function() {
|
|
this.collection.fetch();
|
|
}
|
|
}); |