Commit 4afa785b authored by flothoni's avatar flothoni

database.js; Move anchor creation before the server process call

link to #1469
parent 57ceabbc
Pipeline #68549 canceled with stages
......@@ -147,28 +147,31 @@ Database.prototype = {
btn_id = "btn_get_reads_"+sequence_file_id+"_"+clone_id
document.getElementById(btn_id).classList.add("disabledClass")
// Create anchor here, so each clones/sample will have an specific anchor
// Allow to launch multiple 'get_reads'
var anchors = document.getElementById('dlAnchors')
var anchor_id = "dlAnchor_get_reads_"+a.result_id
var anchor = document.createElement("a", anchor_id)
anchor.innerHTML = "timapoint "+timepoint+"; clone "+m.clones[clone_id]
anchor.classList.add = "disabledClass"
// anchor.style.display = "none"
anchors.appendChild(anchor)
console.log( anchor )
self.callProcess('default/run_request',
{'sequence_file_id': sequence_file_id,
'sample_set_id': self.m.sample_set_id,
'config_id': self.m.db_key.config,
'grep_reads': window},
function(a) {
var anchor_id = "dlAnchor_get_reads_"+a.result_id
// Create anchor here, so each clones/sample will have an specific anchor
// Allow to launch multiple 'get_reads'
var anchors = document.getElementById('dlAnchors')
var anchor = document.createElement("a", anchor_id)
anchor.innerHTML = "timapoint "+timepoint+"; clone "+m.clones[clone_id]
anchor.style.display = "none"
anchors.appendChild(anchor)
console.log( anchor )
var anchors = document.getElementById("dlAnchor_get_reads_"+a.result_id)
// Link to result file and launch download
var path_data = DB_ADDRESS+"/results_file/download?filename=seq/clone.fa-1&results_file_id="+a.result_id
var file_name = "reads__"+clone_id+"__file_id_"+"_"+sequence_file_id+".fa"
anchor.setAttribute("download", file_name);
anchor.setAttribute("href", path_data);
anchor.classList.remove("disabledClass")
self.ajax_indicator_stop()
anchor.click();
// openAndFillNewTab("Your reads are ready. <a href='"+DB_ADDRESS+"/results_file/download?filename=seq/clone.fa-1&results_file_id="+a.result_id+"'>Download them</a>");
......
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