|
|
@ -3,33 +3,34 @@
|
|
|
|
define(['app', 'Calendar/CalendarItemView'], function (app) {
|
|
|
|
define(['app', 'Calendar/CalendarItemView'], function (app) {
|
|
|
|
NzbDrone.Calendar.CalendarCollectionView = Backbone.Marionette.CompositeView.extend({
|
|
|
|
NzbDrone.Calendar.CalendarCollectionView = Backbone.Marionette.CompositeView.extend({
|
|
|
|
itemView: NzbDrone.Calendar.CalendarItemView,
|
|
|
|
itemView: NzbDrone.Calendar.CalendarItemView,
|
|
|
|
|
|
|
|
itemViewContainer: '#fakeContainer',
|
|
|
|
template: 'Calendar/CalendarCollectionTemplate',
|
|
|
|
template: 'Calendar/CalendarCollectionTemplate',
|
|
|
|
itemViewContainer: 'table',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui: {
|
|
|
|
ui: {
|
|
|
|
calendar: '#calendar'
|
|
|
|
calendar: '#calendar'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
initialize: function (context, collection) {
|
|
|
|
this.collection = new NzbDrone.Calendar.CalendarCollection();
|
|
|
|
this.collection = collection;
|
|
|
|
this.collection.fetch();
|
|
|
|
|
|
|
|
this.collection.bind('reset', this.addAll);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
render: function() {
|
|
|
|
onRender: function() {
|
|
|
|
this.ui.calendar.fullCalendar({
|
|
|
|
$(this.ui.calendar).fullCalendar({
|
|
|
|
header: {
|
|
|
|
header: {
|
|
|
|
left: 'prev,next today',
|
|
|
|
left: 'prev,next today',
|
|
|
|
center: 'title',
|
|
|
|
center: 'title',
|
|
|
|
right: 'month,basicWeek,basicDay',
|
|
|
|
right: 'month,basicWeek',
|
|
|
|
ignoreTimezone: false
|
|
|
|
ignoreTimezone: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
selectable: true,
|
|
|
|
buttonText: {
|
|
|
|
selectHelper: true,
|
|
|
|
prev: '<i class="icon-arrow-left"></i>',
|
|
|
|
editable: true
|
|
|
|
next: '<i class="icon-arrow-right"></i>'
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(this.ui.calendar).fullCalendar('addEventSource', this.collection.toJSON());
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addAll: function(){
|
|
|
|
addAll: function(){
|
|
|
|
this.el.fullCalendar('addEventSource', this.collection.toJSON());
|
|
|
|
$(this.ui.calendar).fullCalendar('addEventSource', this.collection.toJSON());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|