1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/Calendar/UpcomingItemView.js
2013-08-21 20:34:46 -07:00

32 lines
856 B
JavaScript

'use strict';
define(
[
'app',
'marionette',
'moment'
], function (App, Marionette, Moment) {
return Marionette.ItemView.extend({
template: 'Calendar/UpcomingItemViewTemplate',
tagName : 'div',
events: {
'click .x-episode-title': '_showEpisodeDetails'
},
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});
}
});
});