From 6a92fdc5e6ddd6ceb44d7ef5cfde942ff0e3c8f5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 8 Jul 2015 19:52:44 +0100 Subject: [PATCH] Fix file size display --- skins/base/views/molecules/MFileTile.js | 1 - src/controllers/molecules/MFileTile.js | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/skins/base/views/molecules/MFileTile.js b/skins/base/views/molecules/MFileTile.js index 712656b4..c54c02ae 100644 --- a/skins/base/views/molecules/MFileTile.js +++ b/skins/base/views/molecules/MFileTile.js @@ -17,7 +17,6 @@ limitations under the License. 'use strict'; var React = require('react'); -var filesize = require('filesize'); var MFileTileController = require("../../../../src/controllers/molecules/MFileTile"); diff --git a/src/controllers/molecules/MFileTile.js b/src/controllers/molecules/MFileTile.js index 68b1983b..7b5515fa 100644 --- a/src/controllers/molecules/MFileTile.js +++ b/src/controllers/molecules/MFileTile.js @@ -16,6 +16,8 @@ limitations under the License. 'use strict'; +var filesize = require('filesize'); + module.exports = { presentableTextForFile: function(content) { var linkText = 'Attachment'; @@ -28,7 +30,7 @@ module.exports = { if (content.info.mimetype && content.info.mimetype.length > 0) { additionals.push(content.info.mimetype); } - if (content.info.size && content.info.size.length > 0) { + if (content.info.size) { additionals.push(filesize(content.info.size)); } }