summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/js/files.js9
2 files changed, 8 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 41245c00ba6..e3e985af38b 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -185,7 +185,7 @@ var FileList={
if (id != null) {
tr.attr('data-id', id);
}
- var path = $('#dir').val()+'/'+name;
+ var path = getPathForPreview(name);
lazyLoadPreview(path, mime, function(previewpath){
tr.find('td.filename').attr('style','background-image:url('+previewpath+')');
});
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index f88ecd961b1..79fa01aa0aa 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -382,7 +382,7 @@ $(document).ready(function() {
tr.attr('data-size',result.data.size);
tr.attr('data-id', result.data.id);
tr.find('.filesize').text(humanFileSize(result.data.size));
- var path = $('#dir').val() + '/' + name;
+ var path = getPathForPreview(name);
lazyLoadPreview(path, result.data.mime, function(previewpath){
tr.find('td.filename').attr('style','background-image:url('+previewpath+')');
});
@@ -654,7 +654,7 @@ var createDragShadow = function(event){
if (elem.type === 'dir') {
newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')');
} else {
- var path = $('#dir').val()+'/'+elem.name;
+ var path = getPathForPreview(elem.name);
lazyLoadPreview(path, elem.mime, function(previewpath){
newtr.find('td.filename').attr('style','background-image:url('+previewpath+')');
});
@@ -832,6 +832,11 @@ function getMimeIcon(mime, ready){
}
getMimeIcon.cache={};
+function getPathForPreview(name) {
+ var path = $('#dir').val() + '/' + name;
+ return path;
+}
+
function lazyLoadPreview(path, mime, ready) {
getMimeIcon(mime,ready);
var x = $('#filestable').data('preview-x');