1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 03:15:19 +00:00
Radarr/NzbDrone.Backbone/Calendar/CalendarCollectionView.js
2013-02-24 16:00:44 -08:00

36 lines
No EOL
1.2 KiB
JavaScript

'use strict';
define(['app', 'Calendar/CalendarItemView'], function (app) {
NzbDrone.Calendar.CalendarCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Calendar.CalendarItemView,
itemViewContainer: '#fakeContainer',
template: 'Calendar/CalendarCollectionTemplate',
ui: {
calendar: '#calendar'
},
initialize: function (context, collection) {
this.collection = collection;
},
onRender: function() {
$(this.ui.calendar).fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek',
ignoreTimezone: false
},
buttonText: {
prev: '<i class="icon-arrow-left"></i>',
next: '<i class="icon-arrow-right"></i>'
}
});
$(this.ui.calendar).fullCalendar('addEventSource', this.collection.toJSON());
},
addAll: function(){
$(this.ui.calendar).fullCalendar('addEventSource', this.collection.toJSON());
}
});
});