mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 00:23:59 -07:00
Moved source code under src folder - massive change
This commit is contained in:
parent
2fc8123d6b
commit
5bf0e197ec
1499 changed files with 1054 additions and 1444 deletions
54
src/UI/Cells/EpisodeActionsCell.js
Normal file
54
src/UI/Cells/EpisodeActionsCell.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'Cells/NzbDroneCell',
|
||||
'Commands/CommandController'
|
||||
], function (App, NzbDroneCell, CommandController) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className: 'episode-actions-cell',
|
||||
template : 'Cells/EpisodeActionsCellTemplate',
|
||||
|
||||
ui: {
|
||||
automaticSearch: '.x-automatic-search-icon'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-automatic-search': '_automaticSearch',
|
||||
'click .x-manual-search' : '_manualSearch'
|
||||
},
|
||||
|
||||
render: function () {
|
||||
var templateName = this.column.get('template') || this.template;
|
||||
|
||||
this.templateFunction = Marionette.TemplateCache.get(templateName);
|
||||
var data = this.cellValue.toJSON();
|
||||
var html = this.templateFunction(data);
|
||||
this.$el.html(html);
|
||||
|
||||
CommandController.bindToCommand({
|
||||
element: this.$(this.ui.automaticSearch),
|
||||
command: {
|
||||
name : 'episodeSearch',
|
||||
episodeId: this.model.get('id')
|
||||
}
|
||||
});
|
||||
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
},
|
||||
|
||||
_automaticSearch: function () {
|
||||
CommandController.Execute('episodeSearch', {
|
||||
name : 'episodeSearch',
|
||||
episodeId: this.model.get('id')
|
||||
});
|
||||
},
|
||||
|
||||
_manualSearch: function () {
|
||||
App.vent.trigger(App.Commands.ShowEpisodeDetails, { episode: this.cellValue, hideSeriesLink: true, openingTab: 'search' });
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue