1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-30 20:05:41 +00:00
Radarr/UI/Series/Index/Posters/ItemView.js

58 lines
1.5 KiB
JavaScript
Raw Normal View History

2013-04-24 03:11:45 +00:00
'use strict';
define([
'app',
'Quality/QualityProfileCollection',
'Series/SeriesCollection',
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView'
], function () {
NzbDrone.Series.Index.Posters.ItemView = Backbone.Marionette.ItemView.extend({
tagName : 'li',
template: 'Series/Index/Posters/ItemTemplate',
ui: {
'progressbar': '.progress .bar',
2013-04-25 18:58:38 +00:00
'airDate': '.air-date',
'controls': '.series-controls'
2013-04-24 03:11:45 +00:00
},
events: {
'click .x-edit' : 'editSeries',
2013-04-25 18:58:38 +00:00
'click .x-remove': 'removeSeries',
'mouseenter .x-series-poster': 'posterHoverAction',
'mouseleave .x-series-poster': 'posterHoverAction'
2013-04-24 03:11:45 +00:00
},
initialize: function (options) {
this.qualityProfileCollection = options.qualityProfiles;
},
onRender: function () {
this.ui.airDate.tooltip();
},
2013-04-24 03:11:45 +00:00
editSeries: function () {
var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model});
NzbDrone.vent.trigger(NzbDrone.Events.OpenModalDialog, {
view: view
});
},
removeSeries: function () {
var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model });
NzbDrone.vent.trigger(NzbDrone.Events.OpenModalDialog, {
view: view
});
2013-04-25 18:58:38 +00:00
},
posterHoverAction: function () {
this.ui.controls.slideToggle();
2013-04-24 03:11:45 +00:00
}
});
});