From a6c653651f1ea0dbc00bbd279d9b5db92d37e487 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 11 Feb 2014 19:05:13 -0800 Subject: [PATCH] Fixed: Changing quality of episode file --- src/UI/Cells/Edit/QualityCellEditor.js | 6 ++++-- src/UI/Cells/Edit/QualityCellEditorTemplate.html | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/UI/Cells/Edit/QualityCellEditor.js b/src/UI/Cells/Edit/QualityCellEditor.js index 2f238da38..934a36fa3 100644 --- a/src/UI/Cells/Edit/QualityCellEditor.js +++ b/src/UI/Cells/Edit/QualityCellEditor.js @@ -28,10 +28,12 @@ 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('items'), function (model) { + return model.quality.id === self.model.get(self.column.get('name')).quality.id; + }); if (selected) { - selected.selected = true; + selected.quality.selected = true; } self.templateFunction = Marionette.TemplateCache.get(templateName); diff --git a/src/UI/Cells/Edit/QualityCellEditorTemplate.html b/src/UI/Cells/Edit/QualityCellEditorTemplate.html index 92d3bea99..4916cf284 100644 --- a/src/UI/Cells/Edit/QualityCellEditorTemplate.html +++ b/src/UI/Cells/Edit/QualityCellEditorTemplate.html @@ -1,7 +1,9 @@ -{{#each available}} - {{#if selected}} - - {{else}} - - {{/if}} +{{#each items}} + {{#with quality}} + {{#if selected}} + + {{else}} + + {{/if}} + {{/with}} {{/each}} \ No newline at end of file