1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-24 22:36:19 -04:00
Files
Sonarr/src/UI/Calendar/UpcomingCollectionView.js
T
Keivan Beigi 0ee5261a2a stripBom
2015-01-29 18:10:16 -08:00

31 lines
927 B
JavaScript

'use strict';
define(
[
'underscore',
'marionette',
'Calendar/UpcomingCollection',
'Calendar/UpcomingItemView',
'Mixins/backbone.signalr.mixin'
], function (_, Marionette, UpcomingCollection, UpcomingItemView) {
return 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();
}
});
});