More Calendar!

This commit is contained in:
Mark McDowall 2013-02-24 16:00:17 -08:00
commit ed3a503342
21 changed files with 72 additions and 54 deletions

View file

@ -3,33 +3,34 @@
define(['app', 'Calendar/CalendarItemView'], function (app) {
NzbDrone.Calendar.CalendarCollectionView = Backbone.Marionette.CompositeView.extend({
itemView: NzbDrone.Calendar.CalendarItemView,
itemViewContainer: '#fakeContainer',
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);
initialize: function (context, collection) {
this.collection = collection;
},
render: function() {
this.ui.calendar.fullCalendar({
onRender: function() {
$(this.ui.calendar).fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay',
right: 'month,basicWeek',
ignoreTimezone: false
},
selectable: true,
selectHelper: true,
editable: true
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.el.fullCalendar('addEventSource', this.collection.toJSON());
$(this.ui.calendar).fullCalendar('addEventSource', this.collection.toJSON());
}
});
});