From 52be133444c45e8ed915c674c4afff3e015d9e93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr>
Date: Thu, 22 Jan 2015 11:28:20 +0100
Subject: [PATCH] =?UTF-8?q?Reformate=20les=20tailles=20de=20fichier=20?=
 =?UTF-8?q?=C3=A0=20l'activation.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Resources/js/widget/file_upload.js | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/Resources/js/widget/file_upload.js b/Resources/js/widget/file_upload.js
index 0028c3ff..8b02e92e 100644
--- a/Resources/js/widget/file_upload.js
+++ b/Resources/js/widget/file_upload.js
@@ -20,17 +20,22 @@
         delete options.downloadPrototype;
 
         var formatSize = function(size) {
-            if(size > 1000000000) {
-                return (size/1000000000).toFixed(2) + '&nbsp;Gio';
-            }
-            if(size > 1000000) {
-                return (size/1000000).toFixed(2) + '&nbsp;Mio';
-            }
-            if(size > 1000) {
-                return (size/1000).toFixed(2)+ '&nbsp;Kio';
-            }
-            return size + '&nbsp;o';
-        };
+                if(size > 1000000000) {
+                    return (size/1000000000).toFixed(2) + '&nbsp;Gio';
+                }
+                if(size > 1000000) {
+                    return (size/1000000).toFixed(2) + '&nbsp;Mio';
+                }
+                if(size > 1000) {
+                    return (size/1000).toFixed(2)+ '&nbsp;Kio';
+                }
+                return size + '&nbsp;o';
+            },
+            formatBitrate = function(rate) {
+                return formatSize(rate) + '/s';
+            };
+
+        $this.find('.template-download .size').each(function() { $(this).html(formatSize($(this).text())); });
 
         var formatBitrate = function(rate) { return formatSize(rate) + '/s'; };
 
-- 
GitLab