reindent, fix obscur perf pb w/ ff 3.0.11 by performing search on the form instead of the whole document
--- a/web/data/cubicweb.preferences.js Wed Jun 24 18:04:27 2009 +0200
+++ b/web/data/cubicweb.preferences.js Wed Jun 24 18:59:01 2009 +0200
@@ -114,36 +114,37 @@
function setCurrentValues(form){
jQuery(form).find('[name^=value]').each(function () {
- var input = jQuery(this);
- var name = input.attr('name');
- if(input.attr('type') == 'radio'){
- // NOTE: there seems to be a bug with jQuery(input).attr('checked')
- // in our case, we can't rely on its value, we use
- // the DOM API instead.
- if(input[0].checked){
- prefsValues[name] = input.val();
- }
- }else{
+ var input = jQuery(this);
+ var name = input.attr('name');
+ if(input.attr('type') == 'radio'){
+ // NOTE: there seems to be a bug with jQuery(input).attr('checked')
+ // in our case, we can't rely on its value, we use
+ // the DOM API instead.
+ if(input[0].checked){
prefsValues[name] = input.val();
}
- jQuery('[name=edits-'+ name + ']').val(prefsValues[name]);
- });
+ }else{
+ prefsValues[name] = input.val();
+ }
+ jQuery(form).find('input[name=edits-'+ name + ']').val(prefsValues[name]);
+ });
}
function initEvents(){
- jQuery('form').each(function() {
- var form = jQuery(this);
- freezeFormButtons(form.attr('id'));
- form.find('input[type=text]').keyup(function(){
- checkValues(form);
- });
- form.find('input[type=radio]').change(function(){
- checkValues(form);
- });
- form.find('select').change(function(){
- checkValues(form);
- });
- setCurrentValues(form);
+ jQuery('form').each(function() {
+ var form = jQuery(this);
+ //freezeFormButtons(form.attr('id'));
+ form.find('input.validateButton').attr('disabled', 'disabled');
+ form.find('input[type=text]').keyup(function(){
+ checkValues(form);
+ });
+ form.find('input[type=radio]').change(function(){
+ checkValues(form);
+ });
+ form.find('select').change(function(){
+ checkValues(form);
+ });
+ setCurrentValues(form);
});
}