Skip to content
Snippets Groups Projects
Commit b7a5e75a authored by juanf's avatar juanf
Browse files

SSDM-1453 : Sample Table shows the first image from preview datasets when more than one.

SVN: 33401
parent fb3d4817
No related branches found
No related tags found
No related merge requests found
...@@ -99,13 +99,18 @@ function SampleTableController(parentController, title, experimentIdentifier) { ...@@ -99,13 +99,18 @@ function SampleTableController(parentController, title, experimentIdentifier) {
mainController.serverFacade.searchDataSetsWithTypeForSamples("ELN_PREVIEW", [data.permId], function(data) { mainController.serverFacade.searchDataSetsWithTypeForSamples("ELN_PREVIEW", [data.permId], function(data) {
data.result.forEach(function(dataset) { data.result.forEach(function(dataset) {
var listFilesForDataSetCallback = function(dataFiles) { var listFilesForDataSetCallback = function(dataFiles) {
var downloadUrl = profile.allDataStores[0].downloadUrl + '/' + dataset.code + "/" + dataFiles.result[1].pathInDataSet + "?sessionID=" + mainController.serverFacade.getSession(); for(var pathIdx = 0; pathIdx < dataFiles.result.length; pathIdx++) {
var previewImage = $("<img>", { 'src' : downloadUrl, 'class' : 'zoomableImage', 'style' : 'height:80px;' }); if(!dataFiles.result[pathIdx].isDirectory) {
previewImage.click(function(event) { var downloadUrl = profile.allDataStores[0].downloadUrl + '/' + dataset.code + "/" + dataFiles.result[pathIdx].pathInDataSet + "?sessionID=" + mainController.serverFacade.getSession();
Util.showImage(downloadUrl); var previewImage = $("<img>", { 'src' : downloadUrl, 'class' : 'zoomableImage', 'style' : 'height:80px;' });
event.stopPropagation(); previewImage.click(function(event) {
}); Util.showImage(downloadUrl);
previewContainer.append(previewImage); event.stopPropagation();
});
previewContainer.append(previewImage);
break;
}
}
}; };
mainController.serverFacade.listFilesForDataSet(dataset.code, "/", true, listFilesForDataSetCallback); mainController.serverFacade.listFilesForDataSet(dataset.code, "/", true, listFilesForDataSetCallback);
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment