merge stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Jun 2009 16:59:26 +0200
branchstable
changeset 2160 17d624698661
parent 2159 0ca23d0eace2 (current diff)
parent 2155 1dd3dfc6fd76 (diff)
child 2161 200481e7b156
merge
--- a/web/data/cubicweb.preferences.js	Wed Jun 24 16:59:12 2009 +0200
+++ b/web/data/cubicweb.preferences.js	Wed Jun 24 16:59:26 2009 +0200
@@ -113,21 +113,23 @@
 }
 
 function setCurrentValues(form){
-    jQuery(form).find('input[name^=value]').each(function () {
+    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[input.attr('name')] = input.val();
+		    prefsValues[name] = input.val();
 		}
 	    }else{
-		prefsValues[input.attr('name')] = input.val();
+		prefsValues[name] = input.val();
 	    }
+	    jQuery('[name=edits-'+ name + ']').val(prefsValues[name]);
 	});
 }
-     
+
 function initEvents(){
   jQuery('form').each(function() {
 	  var form = jQuery(this);