mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 06:45:19 -07:00
parent
931cdacf66
commit
3e2e085b6b
1 changed files with 4 additions and 4 deletions
|
@ -7,7 +7,7 @@ var EditProfileItemView = require('./EditProfileItemView');
|
|||
var QualitySortableCollectionView = require('./QualitySortableCollectionView');
|
||||
var EditProfileView = require('./EditProfileView');
|
||||
var DeleteView = require('../DeleteProfileView');
|
||||
var SeriesCollection = require('../../../Series/SeriesCollection');
|
||||
var FullMovieCollection = require('../../../Movies/FullMovieCollection');
|
||||
var Config = require('../../../Config');
|
||||
var AsEditModalView = require('../../../Mixins/AsEditModalView');
|
||||
|
||||
|
@ -28,7 +28,7 @@ var view = Marionette.Layout.extend({
|
|||
initialize : function(options) {
|
||||
this.profileCollection = options.profileCollection;
|
||||
this.itemsCollection = new Backbone.Collection(_.toArray(this.model.get('items')).reverse());
|
||||
this.listenTo(SeriesCollection, 'all', this._updateDisableStatus);
|
||||
this.listenTo(FullMovieCollection, 'all', this._updateDisableStatus);
|
||||
},
|
||||
|
||||
onRender : function() {
|
||||
|
@ -104,14 +104,14 @@ var view = Marionette.Layout.extend({
|
|||
_updateDisableStatus : function() {
|
||||
if (this._isQualityInUse()) {
|
||||
this.ui.deleteButton.addClass('disabled');
|
||||
this.ui.deleteButton.attr('title', 'Can\'t delete a profile that is attached to a series.');
|
||||
this.ui.deleteButton.attr('title', 'Can\'t delete a profile that is attached to a movie.');
|
||||
} else {
|
||||
this.ui.deleteButton.removeClass('disabled');
|
||||
}
|
||||
},
|
||||
|
||||
_isQualityInUse : function() {
|
||||
return SeriesCollection.where({ 'profileId' : this.model.id }).length !== 0;
|
||||
return FullMovieCollection.where({ 'profileId' : this.model.id }).length !== 0;
|
||||
}
|
||||
});
|
||||
module.exports = AsEditModalView.call(view);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue