Radarr/UI/Calendar/CalendarLayout.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

2013-06-22 06:24:24 +00:00
'use strict';
define(
[
'marionette',
'Calendar/UpcomingCollection',
'Calendar/UpcomingCollectionView',
'Calendar/CalendarView',
], function (Marionette, UpcomingCollection, UpcomingCollectionView, CalendarView) {
return Marionette.Layout.extend({
2013-06-07 05:33:01 +00:00
template: 'Calendar/CalendarLayoutTemplate',
regions: {
upcoming: '#x-upcoming',
calendar: '#x-calendar'
},
initialize: function () {
this.upcomingCollection = new UpcomingCollection();
2013-06-07 05:33:01 +00:00
this.upcomingCollection.fetch();
},
onShow: function () {
this._showUpcoming();
this._showCalendar();
},
_showUpcoming: function () {
this.upcoming.show(new UpcomingCollectionView({
2013-06-07 05:33:01 +00:00
collection: this.upcomingCollection
}));
},
_showCalendar: function () {
this.calendar.show(new CalendarView());
2013-06-07 05:33:01 +00:00
}
});
});