aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 3fad3fae7d3..8b66ed6747b 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -366,8 +366,9 @@ $(document).ready(function() {
var tr=$('tr').filterAttr('data-file',name);
tr.attr('data-mime',result.data.mime);
tr.attr('data-id', result.data.id);
- getMimeIcon(result.data.mime,function(path){
- tr.find('td.filename').attr('style','background-image:url('+path+')');
+ var path = $('#dir').val()+'/'+name;
+ getPreviewIcon(path, function(previewpath){
+ tr.find('td.filename').attr('style','background-image:url('+previewpath+')');
});
} else {
OC.dialogs.alert(result.data.message, t('core', 'Error'));
@@ -430,8 +431,9 @@ $(document).ready(function() {
var tr=$('tr').filterAttr('data-file',localName);
tr.data('mime',mime).data('id',id);
tr.attr('data-id', id);
- getMimeIcon(mime,function(path){
- tr.find('td.filename').attr('style','background-image:url('+path+')');
+ var path = $('#dir').val()+'/'+localName;
+ getPreviewIcon(path, function(previewpath){
+ tr.find('td.filename').attr('style','background-image:url('+previewpath+')');
});
});
eventSource.listen('error',function(error){
@@ -636,8 +638,9 @@ var createDragShadow = function(event){
if (elem.type === 'dir') {
newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')');
} else {
- getMimeIcon(elem.mime,function(path){
- newtr.find('td.filename').attr('style','background-image:url('+path+')');
+ var path = $('#dir').val()+'/'+elem.name;
+ getPreviewIcon(path, function(previewpath){
+ newtr.find('td.filename').attr('style','background-image:url('+previewpath+')');
});
}
});
@@ -821,6 +824,10 @@ function getMimeIcon(mime, ready){
}
getMimeIcon.cache={};
+function getPreviewIcon(path, ready){
+ ready(OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:36, y:36}));
+}
+
function getUniqueName(name){
if($('tr').filterAttr('data-file',name).length>0){
var parts=name.split('.');
@@ -852,4 +859,4 @@ function checkTrashStatus() {
$("input[type=button][id=trash]").removeAttr("disabled");
}
});
-} \ No newline at end of file
+}