Skip to content
Snippets Groups Projects
Commit cee44e3e authored by yvesn's avatar yvesn
Browse files

SDM-5545: when loading preview images, the spinner in only added once

parent 4498fc4a
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ function ImagePreviewIconLoader() { ...@@ -34,7 +34,7 @@ function ImagePreviewIconLoader() {
} }
this._shouldLoadPreview = function(node) { this._shouldLoadPreview = function(node) {
return ! node.data.previewLoaded && node.data.fileSize <= profile.datasetViewerMaxFilesizeForImagePreview; return ! node.data.previewLoading && ! node.data.previewLoaded && node.data.fileSize <= profile.datasetViewerMaxFilesizeForImagePreview;
} }
this._addToQueue = function(node) { this._addToQueue = function(node) {
...@@ -89,6 +89,8 @@ function ImagePreviewIconLoader() { ...@@ -89,6 +89,8 @@ function ImagePreviewIconLoader() {
*/ */
this._loadImagePreview = function(params) { this._loadImagePreview = function(params) {
params.node.data.previewLoading = true;
var $span = $(params.node.span); var $span = $(params.node.span);
var $imageContainer = $span.children("#image-container"); var $imageContainer = $span.children("#image-container");
...@@ -122,6 +124,7 @@ function ImagePreviewIconLoader() { ...@@ -122,6 +124,7 @@ function ImagePreviewIconLoader() {
$imageContainer.append($iconImg); $imageContainer.append($iconImg);
params.node.data.previewLoaded = true; params.node.data.previewLoaded = true;
params.node.data.previewLoading = false;
params.done(); params.done();
}); });
} }
......
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