From a2f275232213192b56c46a4a5022e326d6aef40b Mon Sep 17 00:00:00 2001 From: cramakri <cramakri> Date: Wed, 16 Nov 2011 15:06:22 +0000 Subject: [PATCH] LMS-2638 Finished SVN: 23693 --- .../html/downloader/openbis-dendrogram.html | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/deep_sequencing_unit/source/html/downloader/openbis-dendrogram.html b/deep_sequencing_unit/source/html/downloader/openbis-dendrogram.html index 53337387617..fd4f066fc9b 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(); -- GitLab