]> source.dussan.org Git - nextcloud-server.git/commitdiff
add size tooltip for selected files
authorRobin Appelman <icewind1991@gmail.com>
Thu, 28 Jul 2011 21:56:42 +0000 (23:56 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Thu, 28 Jul 2011 21:56:42 +0000 (23:56 +0200)
files/js/files.js

index 44ec0b23846bd233d6906222f6016c8962ed8fee..f68e4d0c3cd9dc9706ababee24da46758cff92be 100644 (file)
@@ -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){