Commit 2fe5c3e7 authored by flothoni's avatar flothoni

database.js & index; change anchors used for get_reads function

link to #1469
parent 6cbd3d5a
......@@ -344,7 +344,7 @@
<form id="form"></form>
<div id="tip-container"></div>
<a id ="dlAnchor_data-area" style="display:none"></a>
<a id ="dlAnchors" style="display:none"></a>
</body>
</html>
......@@ -134,12 +134,23 @@ Database.prototype = {
'config_id': self.m.db_key.config,
'grep_reads': window},
function(a) {
var path_data = DB_ADDRESS+"/results_file/download?filename=seq/clone.fa-1&results_file_id="+a.result_id
var dlAnchorElem = document.getElementById("dlAnchor_data-area");
dlAnchorElem.setAttribute("href", path_data );
console.log( dlAnchorElem )
dlAnchorElem.setAttribute("download", "results_file_id_"+a.result_id+"_"+sequence_file_id+".fa");
dlAnchorElem.click();
var path_data = DB_ADDRESS+"/results_file/download?filename=seq/clone.fa-1&results_file_id="+a.result_id
var anchor_id = "dlAnchor_get_reads_"+a.result_id
// On pourrait avoir le window ou bien le top du clone. Cela permettrait alors de l'indiqué dans le nom du fichier (qui sinon est le même qu'importe le clone considéré).
var file_name = "getreads__"+window+"__file_id_"+a.result_id+"_"+sequence_file_id+".fa"
// 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.style.display = "none"
anchors.appendChild(anchor)
console.log( anchor )
// Link to result file and launch download
anchor.setAttribute("href", path_data);
anchor.setAttribute("download", file_nane);
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