sonarr-repo-only/UI/Series/Index/Posters/ItemView.js

45 lines
1.2 KiB
JavaScript
Raw Normal View History

'use strict';
2013-04-24 03:11:45 +00:00
define(
[
'app',
'marionette',
'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView'
2013-04-24 03:11:45 +00:00
], function (App, Marionette, EditSeriesView, DeleteSeriesView) {
2013-04-24 03:11:45 +00:00
return Marionette.ItemView.extend({
tagName : 'li',
template: 'Series/Index/Posters/ItemTemplate',
2013-04-24 03:11:45 +00:00
ui: {
'progressbar': '.progress .bar',
'controls' : '.series-controls'
},
2013-04-24 03:11:45 +00:00
events: {
'click .x-edit' : 'editSeries',
'click .x-remove' : 'removeSeries',
'mouseenter .x-series-poster': 'posterHoverAction',
'mouseleave .x-series-poster': 'posterHoverAction'
},
2013-04-24 03:11:45 +00:00
editSeries: function () {
var view = new EditSeriesView({ model: this.model});
App.modalRegion.show(view);
},
2013-04-24 03:11:45 +00:00
removeSeries: function () {
var view = new DeleteSeriesView({ model: this.model });
App.modalRegion.show(view);
},
2013-04-25 18:58:38 +00:00
posterHoverAction: function () {
this.ui.controls.slideToggle();
}
});
2013-04-24 03:11:45 +00:00
});