Browse Source

Unable to hide & reorder profiles. fix #3437

pull/3465/head
Ruud 11 years ago
parent
commit
58bd9cd7a1
  1. 12
      couchpotato/core/plugins/quality/static/quality.js

12
couchpotato/core/plugins/quality/static/quality.js

@ -8,6 +8,7 @@ var QualityBase = new Class({
self.qualities = data.qualities; self.qualities = data.qualities;
self.profiles_list = null;
self.profiles = []; self.profiles = [];
Array.each(data.profiles, self.createProfilesClass.bind(self)); Array.each(data.profiles, self.createProfilesClass.bind(self));
@ -35,7 +36,7 @@ var QualityBase = new Class({
}).pick(); }).pick();
} }
catch(e){} catch(e){}
return {} return {}
}, },
@ -106,14 +107,13 @@ var QualityBase = new Class({
createProfileOrdering: function(){ createProfileOrdering: function(){
var self = this; var self = this;
var profile_list;
self.settings.createGroup({ self.settings.createGroup({
'label': 'Profile Defaults', 'label': 'Profile Defaults',
'description': '(Needs refresh \'' +(App.isMac() ? 'CMD+R' : 'F5')+ '\' after editing)' 'description': '(Needs refresh \'' +(App.isMac() ? 'CMD+R' : 'F5')+ '\' after editing)'
}).adopt( }).adopt(
new Element('.ctrlHolder#profile_ordering').adopt( new Element('.ctrlHolder#profile_ordering').adopt(
new Element('label[text=Order]'), new Element('label[text=Order]'),
profile_list = new Element('ul'), self.profiles_list = new Element('ul'),
new Element('p.formHint', { new Element('p.formHint', {
'html': 'Change the order the profiles are in the dropdown list. Uncheck to hide it completely.<br />First one will be default.' 'html': 'Change the order the profiles are in the dropdown list. Uncheck to hide it completely.<br />First one will be default.'
}) })
@ -133,7 +133,7 @@ var QualityBase = new Class({
'text': profile.data.label 'text': profile.data.label
}), }),
new Element('span.handle') new Element('span.handle')
).inject(profile_list); ).inject(self.profiles_list);
new Form.Check(check); new Form.Check(check);
@ -141,7 +141,7 @@ var QualityBase = new Class({
// Sortable // Sortable
var sorted_changed = false; var sorted_changed = false;
self.profile_sortable = new Sortables(profile_list, { self.profile_sortable = new Sortables(self.profiles_list, {
'revert': true, 'revert': true,
'handle': '.handle', 'handle': '.handle',
'opacity': 0.5, 'opacity': 0.5,
@ -163,7 +163,7 @@ var QualityBase = new Class({
ids = [], ids = [],
hidden = []; hidden = [];
self.profile_sortable.list.getElements('li').each(function(el, nr){ self.profiles_list.getElements('li').each(function(el, nr){
ids.include(el.get('data-id')); ids.include(el.get('data-id'));
hidden[nr] = +!el.getElement('input[type=checkbox]').get('checked'); hidden[nr] = +!el.getElement('input[type=checkbox]').get('checked');
}); });

Loading…
Cancel
Save