diff --git a/deep_sequencing_unit/source/html/downloader/openbis-dendrogram.html b/deep_sequencing_unit/source/html/downloader/openbis-dendrogram.html index 5333738761792f30151ab09ff2cc1ee3d8cca677..fd4f066fc9b682314641dc5fb8b265b6cd0712a4 100644 --- a/deep_sequencing_unit/source/html/downloader/openbis-dendrogram.html +++ b/deep_sequencing_unit/source/html/downloader/openbis-dendrogram.html @@ -341,16 +341,21 @@ function updateInspectors(duration) .append("caption").text(function(d) { return d; }); // We just want to see non-directories here - var downloadTableRow = - downloadTable.selectAll("tr") - .data(function(d) { return (d.files) ? d.files.filter(function(file) { return !file.isDirectory }) : [] }) + var downloadTableRow = downloadTable.selectAll("tr").data(filesForSequencingSample, function(d) { return d.pathInDataSet }); + downloadTableRow .enter() .append("tr") .append("td") .style("text-align", "left") .on("click", downloadTableFile) .text(function(d) { return d.pathInListing }); - + downloadTableRow + .exit() + .transition() + .duration(duration) + .style("opacity", "0") + .remove(); + inspector.exit().transition() .duration(duration) .style("opacity", "0") @@ -378,12 +383,13 @@ function retrieveFilesForSequencingSample(sequencing) // No point getting files for a sample that hasn't been sequenced if (!hasSampleBeenSequenced(sequencing)) return; + sequencing.loadingFiles = true; + dsu.retrieveDataSetsForSequencingSample(sequencing, function(data) { if (!data.result) return; sequencing.datasets = data.result.map(function(bisds) { return {bis : bisds} }); sequencing.files = []; - sequencing.loadingFiles = true; // Get all the files and update the inspectors once all the data is avilable var deferrer = @@ -443,6 +449,12 @@ function downloadTableFile(d) dsu.server.getDownloadUrlForFileForDataSet(d.dataset.bis.code, d.pathInDataSet, action); } +function filesForSequencingSample(d) +{ + if (d.loadingFiles) return [{ pathInListing : "Loading..." }]; + return (d.files) ? d.files.filter(function(file) { return !file.isDirectory }) : []; +} + function enterApp() { $("#login-form-div").hide();