Commit 7e871dda authored by Ryan Herbert's avatar Ryan Herbert
Browse files

fix upload_field onchange

During refactoring this feature was broken, rendering uploads
impossible, this reimplements the feature correctly and separates it
into it's own function
parent 74622a6a
......@@ -346,6 +346,15 @@ Database.prototype = {
}
}
},
upload_file_onChange : function (target_id, value) {
var target = document.getElementById(target_id);
var lastIndex = value.lastIndexOf('\\');
if (lastIndex > 0) {
value = value.substring(lastIndex + 1);
}
target.value = value;
},
/**
* callback function for callURL() <br>
......
......@@ -222,7 +222,7 @@ FileFormBuilder.prototype.build_file_fieldset = function() {
var file1 = this.build_file_field(1, false);
var file_input = file1.getElementsByTagName('input')[0];
file_input.onchange = function() {
document.getElementById('file_filename_' + self.index).value = this.value;
db.upload_file_onChange('file_filename_' + self.index, this.value);
}
f.appendChild(file1);
f.appendChild(this.build_file_field(2, true));
......
......@@ -24,7 +24,6 @@
{{if source_module_active:}}
disabled
{{pass}}
onchange="document.getElementById('file_filename_{{=i}}').value=this.value"
><span>* (.fa, .fastq, .fa.gz, .fastq.gz, .clntab)</span>
</div>
<div class="jstree_container" {{if not source_module_active:}} hidden {{pass}}>
......
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