Commit f7024ed4d882ff57df616f056ffb2b63910de8ba
1 parent
73c81f07
Exists in
master
and in
1 other branch
fixed bug with impossibility to save issue tracker data
Showing
1 changed file
with
7 additions
and
3 deletions
Show diff stats
public/javascripts/form.js
... | ... | @@ -66,12 +66,16 @@ function removeNestedItem() { |
66 | 66 | |
67 | 67 | |
68 | 68 | function activateTypeSelector(field_class, section_class) { |
69 | - section_class = section_class || field_class+"_params"; // section_class can be deduced if not given | |
69 | + var section_class = section_class || field_class+"_params"; // section_class can be deduced if not given | |
70 | + // disable all inactive tabs to avoid sending its values on server | |
71 | + $('div.'+field_class+' > div.'+section_class).not('.chosen').find('input') | |
72 | + .attr('disabled','disabled').val(''); | |
73 | + | |
70 | 74 | $('div.'+field_class+' input[name*='+field_class+'_type]').live('click', function(){ |
71 | 75 | var chosen = $(this).val(); |
72 | 76 | var wrapper = $(this).closest('.nested'); |
73 | - wrapper.find('div.chosen.'+section_class).removeClass('chosen'); | |
74 | - wrapper.find('div.'+section_class+'.'+chosen).addClass('chosen'); | |
77 | + wrapper.find('div.chosen.'+section_class).removeClass('chosen').attr('disabled','disabled');; | |
78 | + wrapper.find('div.'+section_class+'.'+chosen).addClass('chosen').find('input').removeAttr('disabled'); | |
75 | 79 | }); |
76 | 80 | } |
77 | 81 | ... | ... |