Fixes the behavior of the version radio button of the form to upload new versions of a file

This commit is contained in:
Pedro Teixido Rovira 2017-11-27 14:22:39 +01:00
parent cb2ffafdda
commit fbc717c143
2 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@
</p> </p>
</div> </div>
</div> </div>
<div class="box"> <div class="box" id="file_upload_box">
<p> <p>
<%= label_tag('file_upload', l(:label_new_content)) %> <%= label_tag('file_upload', l(:label_new_content)) %>
<%= render :partial => 'dmsf_upload/form', <%= render :partial => 'dmsf_upload/form',

View File

@ -192,11 +192,11 @@
} }
}); });
$('#file_upload').change(function() { $('#file_upload_box').change(function() {
if($("input[name='version']:checked").val() == '0') { if($("input[name='version']:checked").val() == '0') {
$('#fileMinorVersionRadio').prop('checked', true); $('#version_1').prop('checked', true);
} }
$('#fileSameVersionRadio').prop('disabled', true); $('#version_0').prop('disabled', true);
}); });
$('#newRevisionFormContentToggle').click(function() { $('#newRevisionFormContentToggle').click(function() {