diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2014-06-02 10:38:46 +0200 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2014-06-02 15:33:09 +0200 |
commit | 5d457dafc1d8a2aafb0d630a7f8a5b56cef7d97b (patch) | |
tree | f1bd503c4325abc493b70f10507bfea53186afa7 /apps | |
parent | d39216c5e76b32c496ff39c19bddfbc4fa4247ac (diff) | |
download | nextcloud-server-5d457dafc1d8a2aafb0d630a7f8a5b56cef7d97b.tar.gz nextcloud-server-5d457dafc1d8a2aafb0d630a7f8a5b56cef7d97b.zip |
display "<1 kB" for really small files
* added parameters for humanFileSize to trigger that behaviour
* add unit tests for that
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/filelist.js | 2 | ||||
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 1b2a62137e5..4229988b171 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -613,7 +613,7 @@ // size column if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) { - simpleSize = humanFileSize(parseInt(fileData.size, 10)); + simpleSize = humanFileSize(parseInt(fileData.size, 10), true); sizeColor = Math.round(160-Math.pow((fileData.size/(1024*1024)),2)); } else { simpleSize = t('files', 'Pending'); diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index 855a5c9af51..7d3bc946dd3 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -252,7 +252,7 @@ describe('OCA.Files.FileList tests', function() { size: '0' }; var $tr = fileList.add(fileData); - expect($tr.find('.filesize').text()).toEqual('0 B'); + expect($tr.find('.filesize').text()).toEqual('0 kB'); }); it('adds new file to the end of the list', function() { var $tr; |