sonarr-repo-only/UI/Calendar/UpcomingItemView.js

32 lines
856 B
JavaScript
Raw Normal View History

2013-06-07 05:33:01 +00:00
'use strict';
define(
[
2013-06-28 15:43:37 +00:00
'app',
2013-08-22 00:24:38 +00:00
'marionette',
'moment'
], function (App, Marionette, Moment) {
return Marionette.ItemView.extend({
2013-08-22 00:24:38 +00:00
template: 'Calendar/UpcomingItemViewTemplate',
2013-06-28 15:43:37 +00:00
tagName : 'div',
events: {
'click .x-episode-title': '_showEpisodeDetails'
2013-06-28 15:43:37 +00:00
},
2013-08-22 00:24:38 +00:00
initialize: function () {
var start = this.model.get('airDateUtc');
var runtime = this.model.get('series').runtime;
var end = Moment(start).add('minutes', runtime);
this.model.set({
end: end
})
},
_showEpisodeDetails: function () {
App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: this.model});
2013-06-28 15:43:37 +00:00
}
});
2013-06-07 05:33:01 +00:00
});