From 7b9103387f9c0405cb19f6b1add8972a804bfbd8 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Mon, 1 Feb 2016 10:54:43 +0100 Subject: Check exactly at border limit of one megabyte - Issue #550 - Deleted skipped test --- web-ui/app/js/mail_view/ui/attachment_list.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web-ui/app') diff --git a/web-ui/app/js/mail_view/ui/attachment_list.js b/web-ui/app/js/mail_view/ui/attachment_list.js index eb515865..f0581c67 100644 --- a/web-ui/app/js/mail_view/ui/attachment_list.js +++ b/web-ui/app/js/mail_view/ui/attachment_list.js @@ -38,6 +38,9 @@ define( uploadFileButton: '#upload-file-button' }); + var ONE_MEGABYTE = 1024*1024; + var ATTACHMENT_SIZE_LIMIT = ONE_MEGABYTE; + this.showAttachment = function (ev, data) { this.trigger(document, events.mail.appendAttachment, data); this.renderAttachmentListView(data); @@ -89,8 +92,7 @@ define( self.trigger(document, events.mail.startUploadAttachment); }; - var ONE_MEGABYTE = 1000000; - if (data.originalFiles[0].size > ONE_MEGABYTE) { + if (data.originalFiles[0].size > ATTACHMENT_SIZE_LIMIT) { uploadErrors.push('Filesize is too big'); } if (uploadErrors.length > 0) { -- cgit v1.2.3