fixed on air for upcoming view

pull/4/head
Mark McDowall 11 years ago
parent b1fa306223
commit 8737cb0145

@ -3,16 +3,27 @@
define( define(
[ [
'app', 'app',
'marionette' 'marionette',
], function (App, Marionette) { 'moment'
], function (App, Marionette, Moment) {
return Marionette.ItemView.extend({ return Marionette.ItemView.extend({
template: 'Calendar/UpcomingItemTemplate', template: 'Calendar/UpcomingItemViewTemplate',
tagName : 'div', tagName : 'div',
events: { events: {
'click .x-episode-title': '_showEpisodeDetails' '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 () { _showEpisodeDetails: function () {
App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: this.model}); App.vent.trigger(App.Commands.ShowEpisodeDetails, {episode: this.model});
} }

@ -1,5 +1,4 @@
<div class="episode-info"> <div class="episode-info">
{{debug}}
{{#with series}} {{#with series}}
{{qualityProfile qualityProfileId}} {{qualityProfile qualityProfileId}}
<span class="label label-info">{{network}}</span> <span class="label label-info">{{network}}</span>

Loading…
Cancel
Save