mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
removed NzbDrone. namespace, everything is done using require.
This commit is contained in:
parent
ef62af75df
commit
b0bd3f34f1
121 changed files with 2570 additions and 2587 deletions
|
@ -1,44 +1,47 @@
|
|||
'use strict';
|
||||
|
||||
define(['app','backgrid'], function () {
|
||||
NzbDrone.Cells.NzbDroneCell = Backgrid.Cell.extend({
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
_originalInit: Backgrid.Cell.prototype.initialize,
|
||||
_originalInit: Backgrid.Cell.prototype.initialize,
|
||||
|
||||
|
||||
initialize: function () {
|
||||
this._originalInit.apply(this, arguments);
|
||||
this.cellValue = this._getValue();
|
||||
initialize: function () {
|
||||
this._originalInit.apply(this, arguments);
|
||||
this.cellValue = this._getValue();
|
||||
|
||||
this.listenTo(this.model, 'change', this._refresh);
|
||||
},
|
||||
this.listenTo(this.model, 'change', this._refresh);
|
||||
},
|
||||
|
||||
_refresh: function () {
|
||||
this.cellValue = this._getValue();
|
||||
this.render();
|
||||
},
|
||||
_refresh: function () {
|
||||
this.cellValue = this._getValue();
|
||||
this.render();
|
||||
},
|
||||
|
||||
_getValue: function () {
|
||||
_getValue: function () {
|
||||
|
||||
var name = this.column.get('name');
|
||||
var name = this.column.get('name');
|
||||
|
||||
if (name === 'this') {
|
||||
return this.model;
|
||||
if (name === 'this') {
|
||||
return this.model;
|
||||
}
|
||||
|
||||
var value = this.model.get(name);
|
||||
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//if not a model
|
||||
if (!value.get && typeof value === 'object') {
|
||||
value = new Backbone.Model(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
var value = this.model.get(name);
|
||||
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//if not a model
|
||||
if (!value.get && typeof value === 'object') {
|
||||
value = new Backbone.Model(value);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue