From 12b2674bded70dd8f4f9910e52623c6cc2943c26 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 11 Jul 2017 15:24:13 -0700 Subject: [PATCH] Show size of files even if size not precomputed for attachment FREEBIE --- js/views/attachment_view.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/views/attachment_view.js b/js/views/attachment_view.js index f596e3dce..34323de8c 100644 --- a/js/views/attachment_view.js +++ b/js/views/attachment_view.js @@ -71,7 +71,9 @@ }, initialize: function(options) { this.blob = new Blob([this.model.data], {type: this.model.contentType}); - + if (!this.model.size) { + this.model.size = this.model.data.byteLength; + } if (options.timestamp) { this.timestamp = options.timestamp; }