From: Vincent Petry Date: Thu, 17 Dec 2015 10:50:24 +0000 (+0100) Subject: Correctly render uploadtext indicator only on folders X-Git-Tag: v9.0beta1~425^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d27826bac06ca54eeeba73420983a05a1a557cf6;p=nextcloud-server.git Correctly render uploadtext indicator only on folders --- diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 7e1329d1155..ec82117c2b3 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1068,7 +1068,7 @@ nameSpan.tooltip({placement: 'right'}); } // dirs can show the number of uploaded files - if (mime !== 'httpd/unix-directory') { + if (mime === 'httpd/unix-directory') { linkElem.append($('').attr({ 'class': 'uploadtext', 'currentUploads': 0 diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 3542a5cee8f..9dfcdfead7f 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -2402,6 +2402,21 @@ describe('OCA.Files.FileList tests', function() { expect(ev.result).not.toEqual(false); expect(uploadData.targetDir).toEqual('/a/b'); }); + it('renders upload indicator element for folders only', function() { + fileList.add({ + name: 'afolder', + type: 'dir', + mime: 'httpd/unix-directory' + }); + fileList.add({ + name: 'afile.txt', + type: 'file', + mime: 'text/plain' + }); + + expect(fileList.findFileEl('afolder').find('.uploadtext').length).toEqual(1); + expect(fileList.findFileEl('afile.txt').find('.uploadtext').length).toEqual(0); + }); }); }); describe('Handling errors', function () {