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