diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-07-28 23:56:42 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-07-28 23:56:42 +0200 |
commit | 433ad8c3ce80dde20e4fc0ea4cc3edaae2c0654f (patch) | |
tree | 1b30372731a2fb228e46c2c36cee9584c28837ad /files | |
parent | 4028178982ce79824c5420ffabb52804ef6fe573 (diff) | |
download | nextcloud-server-433ad8c3ce80dde20e4fc0ea4cc3edaae2c0654f.tar.gz nextcloud-server-433ad8c3ce80dde20e4fc0ea4cc3edaae2c0654f.zip |
add size tooltip for selected files
Diffstat (limited to 'files')
-rw-r--r-- | files/js/files.js | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/files/js/files.js b/files/js/files.js index 44ec0b23846..f68e4d0c3cd 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -259,7 +259,7 @@ function humanFileSize(bytes){ } function simpleFileSize(bytes) { - mbytes = Math.round(bytes/(1024*1024),1); + mbytes = Math.round(bytes/(1024*1024/10))/10; if(bytes == 0) { return '0'; } else if(mbytes < 0.1) { return '< 0.1'; } else if(mbytes > 1000) { return '> 1000'; } @@ -341,15 +341,9 @@ function procesSelection(){ for(var i=0;i<selectedFolders.length;i++){ totalSize+=selectedFolders[i].size; }; - if(totalSize>0){ - totalSize = Math.round(totalSize/(1024*102.4))/10; - if(totalSize < 0.1) { - totalSize='<0.1'; - }else if(totalSize > 1000) { - totalSize= '>1000'; - } - } - $('#headerSize').text(totalSize+' MB'); + simpleSize=simpleFileSize(totalSize); + $('#headerSize').text(simpleSize+' MB'); + $('#headerSize').attr('title',humanFileSize(totalSize)); var selection=''; if(selectedFolders.length>0){ if(selectedFolders.length==1){ |