mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
added toggle cell for episode ignore status.
This commit is contained in:
parent
ca71025bca
commit
dc2930dc98
6 changed files with 48 additions and 32 deletions
|
@ -1,33 +1,38 @@
|
|||
"use strict";
|
||||
|
||||
define(['app', 'Episode/Layout'], function () {
|
||||
NzbDrone.Series.Details.EpisodeIgnoreCell = Backgrid.Cell.extend({
|
||||
NzbDrone.Shared.Cells.ToggleCell = Backgrid.Cell.extend({
|
||||
|
||||
className: 'toggle-cell clickable',
|
||||
|
||||
events: {
|
||||
'click': '_onClick'
|
||||
},
|
||||
|
||||
|
||||
_onClick: function () {
|
||||
var name = this.column.get('name');
|
||||
this.model.set(name, !this.model.get(name));
|
||||
this.render();
|
||||
|
||||
this.model.save();
|
||||
},
|
||||
|
||||
className: 'episode-status-cell',
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
|
||||
if (this.model) {
|
||||
|
||||
var icon;
|
||||
this.$el.html('<i />');
|
||||
|
||||
if (this.model.get('episodeFile')) {
|
||||
icon = 'icon-ok';
|
||||
var name = this.column.get('name');
|
||||
|
||||
}
|
||||
else {
|
||||
if (this.model.get('hasAired')) {
|
||||
icon = 'icon-warning-sign';
|
||||
}
|
||||
else {
|
||||
icon = 'icon-time';
|
||||
}
|
||||
}
|
||||
|
||||
this.$el.html('<i class="{0}"/>'.format(icon));
|
||||
if (this.model.get(name)) {
|
||||
this.$('i').addClass(this.column.get('trueClass'));
|
||||
}
|
||||
else {
|
||||
this.$('i').addClass(this.column.get('falseClass'));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue