mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
cleaned up all the cells. there is a cell for pretty much everything.
This commit is contained in:
parent
ac3582d5c4
commit
70cfa5e685
42 changed files with 432 additions and 261 deletions
40
UI/Cells/NzbDroneCell.js
Normal file
40
UI/Cells/NzbDroneCell.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
"use strict";
|
||||
|
||||
define(['app'], function () {
|
||||
NzbDrone.Cells.NzbDroneCell = Backgrid.Cell.extend({
|
||||
|
||||
_originalInit: Backgrid.Cell.prototype.initialize,
|
||||
|
||||
|
||||
initialize: function () {
|
||||
this._originalInit.apply(this, arguments);
|
||||
this.cellValue = this._getValue();
|
||||
|
||||
this.model.on('change', this._refresh, this);
|
||||
},
|
||||
|
||||
_refresh: function () {
|
||||
this.cellValue = this._getValue();
|
||||
this.render();
|
||||
},
|
||||
|
||||
_getValue: function () {
|
||||
|
||||
var name = this.column.get('name');
|
||||
|
||||
if(name === 'this'){
|
||||
return this.model;
|
||||
}
|
||||
|
||||
var value = this.model.get(name);
|
||||
|
||||
//if not a model
|
||||
if (!value.get) {
|
||||
return value = new Backbone.Model(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue