|
|
|
@ -2,9 +2,10 @@
|
|
|
|
|
define(
|
|
|
|
|
[
|
|
|
|
|
'backgrid',
|
|
|
|
|
'marionette',
|
|
|
|
|
'underscore',
|
|
|
|
|
'Settings/Quality/Profile/QualityProfileSchemaCollection',
|
|
|
|
|
'Series/EpisodeFileModel'
|
|
|
|
|
], function (Backgrid, QualityProfileSchemaCollection, EpisodeFileModel) {
|
|
|
|
|
], function (Backgrid, Marionette, _, QualityProfileSchemaCollection) {
|
|
|
|
|
return Backgrid.CellEditor.extend({
|
|
|
|
|
|
|
|
|
|
className: 'quality-cell-editor',
|
|
|
|
@ -27,7 +28,7 @@ define(
|
|
|
|
|
var templateName = self.template;
|
|
|
|
|
self.schema = qualityProfileSchemaCollection.first();
|
|
|
|
|
|
|
|
|
|
var selected = _.find(self.schema.get('available'), { 'id': self.model.get(self.column.get("name")).quality.id });
|
|
|
|
|
var selected = _.find(self.schema.get('available'), { 'id': self.model.get(self.column.get('name')).quality.id });
|
|
|
|
|
|
|
|
|
|
if (selected) {
|
|
|
|
|
selected.selected = true;
|
|
|
|
@ -54,9 +55,9 @@ define(
|
|
|
|
|
quality: quality
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
model.set(column.get("name"), newQuality);
|
|
|
|
|
model.set(column.get('name'), newQuality);
|
|
|
|
|
model.save();
|
|
|
|
|
model.trigger("backgrid:edited", model, column, new Backgrid.Command(e));
|
|
|
|
|
model.trigger('backgrid:edited', model, column, new Backgrid.Command(e));
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
close: function (e) {
|
|
|
|
@ -64,7 +65,7 @@ define(
|
|
|
|
|
var column = this.column;
|
|
|
|
|
var command = new Backgrid.Command(e);
|
|
|
|
|
|
|
|
|
|
model.trigger("backgrid:edited", model, column, command);
|
|
|
|
|
model.trigger('backgrid:edited', model, column, command);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|