summaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-12-17 13:12:57 +0100
committerVincent Petry <pvince81@owncloud.com>2014-12-17 13:12:57 +0100
commitab35459cacea49eed0f6d9c5469dac75587df210 (patch)
treef41485448d691b6737f32ba9efc4888a5de8eac3 /apps/files/js/files.js
parent77c4c2856aa4cb27ca6ab77e5bedbaa65300d111 (diff)
downloadnextcloud-server-ab35459cacea49eed0f6d9c5469dac75587df210.tar.gz
nextcloud-server-ab35459cacea49eed0f6d9c5469dac75587df210.zip
Propertly restore thumbnail on cancel/rename/move
Since the thumbnail is now in a div, the code that tries to change the thumbnail have been adapted here as well.
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index b11ef03eab2..314b8bf39c6 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -369,19 +369,22 @@ var createDragShadow = function(event) {
var dir = FileList.getCurrentDirectory();
$(selectedFiles).each(function(i,elem) {
+ // TODO: refactor this with the table row creation code
var newtr = $('<tr/>')
.attr('data-dir', dir)
.attr('data-file', elem.name)
.attr('data-origin', elem.origin);
- newtr.append($('<td/>').addClass('filename').text(elem.name));
- newtr.append($('<td/>').addClass('size').text(OC.Util.humanFileSize(elem.size)));
+ newtr.append($('<td class="filename" />').text(elem.name).css('background-size', 32));
+ newtr.append($('<td class="size" />').text(OC.Util.humanFileSize(elem.size)));
tbody.append(newtr);
if (elem.type === 'dir') {
- newtr.find('td.filename').attr('style','background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')');
+ newtr.find('td.filename')
+ .css('background-image', 'url(' + OC.imagePath('core', 'filetypes/folder.png') + ')');
} else {
var path = dir + '/' + elem.name;
OCA.Files.App.files.lazyLoadPreview(path, elem.mime, function(previewpath) {
- newtr.find('td.filename').attr('style','background-image:url('+previewpath+')');
+ newtr.find('td.filename')
+ .css('background-image', 'url(' + previewpath + ')');
}, null, null, elem.etag);
}
});