You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
44 lines
1.3 KiB
var vent = require('vent');
|
|
var NzbDroneCell = require('./NzbDroneCell');
|
|
var CommandController = require('../Commands/CommandController');
|
|
|
|
module.exports = NzbDroneCell.extend({
|
|
className : 'episode-actions-cell',
|
|
|
|
events : {
|
|
'click .x-automatic-search' : '_automaticSearch',
|
|
'click .x-manual-search' : '_manualSearch'
|
|
},
|
|
|
|
render : function() {
|
|
this.$el.empty();
|
|
|
|
this.$el.html('<i class="icon-lidarr-search x-automatic-search" title="Automatic Search"></i>' + '<i class="icon-lidarr-search-manual x-manual-search" title="Manual Search"></i>');
|
|
|
|
CommandController.bindToCommand({
|
|
element : this.$el.find('.x-automatic-search'),
|
|
command : {
|
|
name : 'episodeSearch',
|
|
episodeIds : [this.model.get('id')]
|
|
}
|
|
});
|
|
|
|
this.delegateEvents();
|
|
return this;
|
|
},
|
|
|
|
_automaticSearch : function() {
|
|
CommandController.Execute('episodeSearch', {
|
|
name : 'episodeSearch',
|
|
episodeIds : [this.model.get('id')]
|
|
});
|
|
},
|
|
|
|
_manualSearch : function() {
|
|
vent.trigger(vent.Commands.ShowEpisodeDetails, {
|
|
episode : this.cellValue,
|
|
hideSeriesLink : true,
|
|
openingTab : 'search'
|
|
});
|
|
}
|
|
}); |