|
@@ -1896,24 +1896,41 @@
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+
|
|
|
function startFallbackThumbnailLoader(){
|
|
|
let startingCurrentDir = currentPath;
|
|
|
+ let fallbackRenderList = [];
|
|
|
$(".fileObject").each(function(){
|
|
|
let filepath = $(this).attr("filepath");
|
|
|
let targetDOM = $(this);
|
|
|
- $.ajax({
|
|
|
- url: "../../system/file_system/loadThumbnail",
|
|
|
- data: {vpath: filepath},
|
|
|
- success: function(data){
|
|
|
- if (startingCurrentDir == currentPath){
|
|
|
- //User still not changed page
|
|
|
- if (data.error == undefined && typeof data != "undefined" && data != ""){
|
|
|
- $(targetDOM).find("img").attr("src","data:image/jpg;base64," + data);
|
|
|
- }
|
|
|
+ if ($(this).attr("type") != "folder"){
|
|
|
+ fallbackRenderList.push([filepath, targetDOM]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ doThumbnailSequentialLoading(startingCurrentDir, fallbackRenderList, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ function doThumbnailSequentialLoading(startingCurrentDir, renderlist, index){
|
|
|
+ let filepath = renderlist[index][0];
|
|
|
+ let targetDOM = renderlist[index][1];
|
|
|
+ $.ajax({
|
|
|
+ url: "../../system/file_system/loadThumbnail",
|
|
|
+ data: {vpath: filepath},
|
|
|
+ success: function(data){
|
|
|
+ if (startingCurrentDir == currentPath){
|
|
|
+ //User still not changed page
|
|
|
+ if (data.error == undefined && typeof data != "undefined" && data != ""){
|
|
|
+ $(targetDOM).find("img").attr("src","data:image/jpg;base64," + data);
|
|
|
}
|
|
|
|
|
|
+ if (index < renderlist.length - 1){
|
|
|
+ doThumbnailSequentialLoading(startingCurrentDir, renderlist, index + 1);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //User changed page. End the sequence
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|