web/data/cubicweb.preferences.js
branchstable
changeset 2155 1dd3dfc6fd76
parent 2154 558079860667
child 2162 14088bb1a103
equal deleted inserted replaced
2154:558079860667 2155:1dd3dfc6fd76
   113 }
   113 }
   114 
   114 
   115 function setCurrentValues(form){
   115 function setCurrentValues(form){
   116     jQuery(form).find('[name^=value]').each(function () {
   116     jQuery(form).find('[name^=value]').each(function () {
   117 	    var input = jQuery(this);
   117 	    var input = jQuery(this);
       
   118 	    var name = input.attr('name');
   118 	    if(input.attr('type') == 'radio'){
   119 	    if(input.attr('type') == 'radio'){
   119 		// NOTE: there seems to be a bug with jQuery(input).attr('checked')
   120 		// NOTE: there seems to be a bug with jQuery(input).attr('checked')
   120 		//       in our case, we can't rely on its value, we use
   121 		//       in our case, we can't rely on its value, we use
   121 		//       the DOM API instead.
   122 		//       the DOM API instead.
   122 		if(input[0].checked){
   123 		if(input[0].checked){
   123 		    prefsValues[input.attr('name')] = input.val();
   124 		    prefsValues[name] = input.val();
   124 		}
   125 		}
   125 	    }else{
   126 	    }else{
   126 		prefsValues[input.attr('name')] = input.val();
   127 		prefsValues[name] = input.val();
   127 	    }
   128 	    }
       
   129 	    jQuery('[name=edits-'+ name + ']').val(prefsValues[name]);
   128 	});
   130 	});
   129 }
   131 }
   130 
   132 
   131 function initEvents(){
   133 function initEvents(){
   132   jQuery('form').each(function() {
   134   jQuery('form').each(function() {