Commit 37b43ede authored by Ryan Herbert's avatar Ryan Herbert

file form fix file field display on mode switch

This fixes a bug with the display of one of the file fields when
swapping to "computer" mode after having added an extra file form.
parent b694a066
......@@ -634,10 +634,12 @@ Database.prototype = {
var elem = $('.upload_field');
var disable = !elem.prop('disabled');
elem.prop('disabled', disable);
elem.closest("div").prop('hidden', disable);
if (disable) {
elem.closest("div").hide();
elem.val(undefined);
$('.filename').val(undefined);
} else {
elem.closest("div").show();
}
var pre_process = $('#pre_process');
......
......@@ -343,7 +343,7 @@ FileFormBuilder.prototype.build_file_field = function(id, hidden) {
var d = this.build_wrapper();
d.className += " file_" + id;
if (this.source || hidden) {
d.hidden = true;
d.style.display = "none";
}
var i = this.build_input('upload_' + id, 'upload_field', 'file'+id, 'file', 'file');
if (this.source) {
......
......@@ -60,7 +60,7 @@
</div>
</div>
<div class="field_div">
<div id="file_field_1_{{=i}}" class="field_div file_1" {{if source_module_active:}} hidden {{pass}}>
<div id="file_field_1_{{=i}}" class="field_div file_1" {{if source_module_active:}} style="display: none" {{pass}}>
<input class="upload_field form-control" id="file_upload_1_{{=i}}" type="file"
{{if source_module_active:}}
disabled
......@@ -69,7 +69,7 @@
title="(.fa, .fastq, .fa.gz, .fastq.gz, .clntab)"
>
</div>
<div id="file_2_{{=i}}" class="field_div file_2" hidden>
<div id="file_2_{{=i}}" class="field_div file_2" style="display: none">
<input class="upload_field form-control" id="file_upload_2_{{=i}}" type="file"
{{if source_module_active:}}
disabled
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment