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.
Radarr/NzbDrone.Backbone/Calendar/CalendarCollectionView.js

35 lines
1.1 KiB

'use strict';
define(['app', 'Calendar/CalendarItemView'], function (app) {
NzbDrone.Calendar.CalendarCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Calendar.CalendarItemView,
template: 'Calendar/CalendarCollectionTemplate',
itemViewContainer: 'table',
ui: {
calendar: '#calendar'
},
initialize: function () {
this.collection = new NzbDrone.Calendar.CalendarCollection();
this.collection.fetch();
this.collection.bind('reset', this.addAll);
},
render: function() {
this.ui.calendar.fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay',
ignoreTimezone: false
},
selectable: true,
selectHelper: true,
editable: true
});
},
addAll: function(){
this.el.fullCalendar('addEventSource', this.collection.toJSON());
}
});
});