summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2014-06-02 10:38:46 +0200
committerMorris Jobke <morris.jobke@gmail.com>2014-06-02 15:33:09 +0200
commit5d457dafc1d8a2aafb0d630a7f8a5b56cef7d97b (patch)
treef1bd503c4325abc493b70f10507bfea53186afa7 /apps
parentd39216c5e76b32c496ff39c19bddfbc4fa4247ac (diff)
downloadnextcloud-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.js2
-rw-r--r--apps/files/tests/js/filelistSpec.js2
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;