Make sure top quality is always checked.

This commit is contained in:
Ruud
2012-09-25 15:47:50 +02:00
parent 24ad975917
commit 7e3a6eeb83
@@ -86,7 +86,10 @@ var Profile = new Class({
}, },
'onComplete': function(json){ 'onComplete': function(json){
if(json.success){ if(json.success){
self.data = json.profile self.data = json.profile;
self.type_container.getElement('li:first-child input[type=checkbox]')
.set('checked', true)
.getParent().addClass('checked');
} }
} }
}); });
@@ -241,7 +244,15 @@ Profile.Type = new Class({
self.finish = new Element('input.inlay.finish[type=checkbox]', { self.finish = new Element('input.inlay.finish[type=checkbox]', {
'checked': data.finish, 'checked': data.finish,
'events': { 'events': {
'change': self.fireEvent.bind(self, 'change') 'change': function(e){
if(self.el == self.el.getParent().getElement(':first-child')){
self.finish_class.check();
alert('Top quality always finishes the search')
return;
}
self.fireEvent('change');
}
} }
}) })
), ),
@@ -255,7 +266,7 @@ Profile.Type = new Class({
self.el[self.data.quality_id > 0 ? 'removeClass' : 'addClass']('is_empty'); self.el[self.data.quality_id > 0 ? 'removeClass' : 'addClass']('is_empty');
new Form.Check(self.finish); self.finish_class = new Form.Check(self.finish);
}, },