mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 03:52:33 +02:00
QualityCell editing cleanup
This commit is contained in:
parent
7c915bd522
commit
5327068557
@ -26,7 +26,7 @@ define(
|
||||
var templateName = self.template;
|
||||
self.schema = qualityProfileSchemaCollection.first();
|
||||
|
||||
var selected = _.find(self.schema.get('available'), { 'id': self.cell.cellValue.get('quality').id });
|
||||
var selected = _.find(self.schema.get('available'), { 'id': self.model.get(self.column.get("name")).quality.id });
|
||||
selected.selected = true;
|
||||
|
||||
self.templateFunction = Marionette.TemplateCache.get(templateName);
|
||||
@ -61,10 +61,6 @@ define(
|
||||
var command = new Backgrid.Command(e);
|
||||
|
||||
model.trigger("backgrid:edited", model, column, command);
|
||||
},
|
||||
|
||||
_setOptions: function (options) {
|
||||
this.cell = options.cell
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -8,18 +8,19 @@ define(
|
||||
|
||||
_originalInit: Backgrid.Cell.prototype.initialize,
|
||||
|
||||
|
||||
initialize: function () {
|
||||
this._originalInit.apply(this, arguments);
|
||||
this.cellValue = this._getValue();
|
||||
|
||||
this.listenTo(this.model, 'change', this._refresh);
|
||||
|
||||
this.listenTo(this.model, "backgrid:edit", function (model, column, cell, editor) {
|
||||
if (column.get("name") == this.column.get("name")) {
|
||||
this._startEditing(model, column, cell, editor);
|
||||
}
|
||||
});
|
||||
if (this._onEdit) {
|
||||
this.listenTo(this.model, "backgrid:edit", function (model, column, cell, editor) {
|
||||
if (column.get("name") == this.column.get("name")) {
|
||||
this._onEdit(model, column, cell, editor);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
_refresh: function () {
|
||||
|
@ -8,10 +8,6 @@ define(
|
||||
|
||||
className: 'quality-cell',
|
||||
template : 'Cells/QualityCellTemplate',
|
||||
editor : QualityCellEditor,
|
||||
|
||||
_startEditing: function (model, column, cell, editor) {
|
||||
editor._setOptions({ cell: cell });
|
||||
}
|
||||
editor : QualityCellEditor
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user