Skip to content

TagSpaces is an offline, open source, document manager with tagging support

load generated tgumbnails

Borislav Sapundzhieva44c6a338a6d
diff --git a/data/ext/perspectiveImageSwiper/perspectiveUI.js b/data/ext/perspectiveImageSwiper/perspectiveUI.js
index e75c61fce..9cb3aca56 100644
--- a/data/ext/perspectiveImageSwiper/perspectiveUI.js
+++ b/data/ext/perspectiveImageSwiper/perspectiveUI.js
@@ -11,6 +11,19 @@ define(function(require, exports, module) {
defaultThumnailPath = extDir + "/default.png";
}
+ function loadThumbnail(fileName) {
+
+ var name = TSCORE.Utils.baseName(fileName);
+ var res = null;
+ TSCORE.metaFileList.forEach(function(element) {
+ if(element.name.indexOf(name) >= 0) {
+ res = element.path;
+ }
+ });
+
+ return res;
+ }
+
function load(container, template, files) {
var data = [];
var compiledTemplate = Handlebars.compile(template);
@@ -25,6 +38,11 @@ define(function(require, exports, module) {
thumbnail: encodeURI(defaultThumnailPath),
title: fileInfo[TSCORE.fileListTITLE]
}
+
+ var thumb = loadThumbnail(doc.path);
+ if(thumb) {
+ doc.thumbnail = thumb;
+ }
data.push(doc);
}
});