diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-12-17 11:50:24 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-12-18 18:09:46 +0100 |
commit | d27826bac06ca54eeeba73420983a05a1a557cf6 (patch) | |
tree | 90df41b1321fd8bcc2d980926b6828d19179f3e7 | |
parent | 95a255b0d4dc4d188022fcd11f0c8c03a76041b7 (diff) | |
download | nextcloud-server-d27826bac06ca54eeeba73420983a05a1a557cf6.tar.gz nextcloud-server-d27826bac06ca54eeeba73420983a05a1a557cf6.zip |
Correctly render uploadtext indicator only on folders
-rw-r--r-- | apps/files/js/filelist.js | 2 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 15 |
2 files changed, 16 insertions, 1 deletions
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($('<span></span>').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 () { |