Commit 6750205c authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Fix bug in run client JS code

parent 7f76d823
......@@ -644,7 +644,7 @@ dgenies.run._start_upload = function(ftype, fname) {
has_uploads = true;
}
else {
dgenies.run.files[0] = undefined;
dgenies.run.files[dgenies.run.files_nb[ftype]] = undefined;
if (fasta_val !== "" && !dgenies.run.check_url(fasta_val)) {
dgenies.run.add_error(`${fname} file: invalid URL`, "error");
dgenies.run.enable_form();
......
......@@ -133,7 +133,7 @@ return!has_errors};/**
* @param fname fasta name
* @returns {boolean} true if has uploads
* @private
*/dgenies.run._start_upload=function(ftype,fname){let has_uploads=false;let fasta_type=parseInt($(`select.${ftype}`).val());let fasta_val=$(`input#${ftype}`).val();if(fasta_type===0&&fasta_val.length>0){$(`button#button-${ftype}`).hide();dgenies.run.show_loading(ftype);has_uploads=true}else{dgenies.run.files[0]=undefined;if(fasta_val!==""&&!dgenies.run.check_url(fasta_val)){dgenies.run.add_error(`${fname} file: invalid URL`,"error");dgenies.run.enable_form();return false}}return has_uploads};/**
*/dgenies.run._start_upload=function(ftype,fname){let has_uploads=false;let fasta_type=parseInt($(`select.${ftype}`).val());let fasta_val=$(`input#${ftype}`).val();if(fasta_type===0&&fasta_val.length>0){$(`button#button-${ftype}`).hide();dgenies.run.show_loading(ftype);has_uploads=true}else{dgenies.run.files[dgenies.run.files_nb[ftype]]=undefined;if(fasta_val!==""&&!dgenies.run.check_url(fasta_val)){dgenies.run.add_error(`${fname} file: invalid URL`,"error");dgenies.run.enable_form();return false}}return has_uploads};/**
* Launch upload of files
*/dgenies.run.start_uploads=function(){let has_uploads=false;let tab=$("#tabs .tab.active").attr("id");let inputs=[];if(tab==="tab1"){dgenies.run.reset_file_form("tab2");inputs=[["query","Query"],["target","Target"]]}else{dgenies.run.reset_file_form("tab1");inputs=[["queryidx","Query"],["targetidx","Target"],["alignfile","Alignment"],["backup","Backup"]]}$.each(inputs,function(i,input){let test_has_uploads=dgenies.run._start_upload(input[0],input[1]);has_uploads=has_uploads||test_has_uploads});if(dgenies.run.valid){if(has_uploads){$("div#uploading-loading").html("Asking for upload...");dgenies.run.ask_for_upload()}else{dgenies.run.upload_next()}}else{dgenies.run.valid=true}};/**
* Show global loading
......
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