diff --git a/js/views/attachment_view.js b/js/views/attachment_view.js index 7b18905b9..25c72e58f 100644 --- a/js/views/attachment_view.js +++ b/js/views/attachment_view.js @@ -71,7 +71,6 @@ var parts = this.model.contentType.split('/'); this.contentType = parts[0]; - this.fileType = parts[1]; if (options.timestamp) { this.timestamp = options.timestamp; } @@ -79,6 +78,12 @@ events: { 'click': 'onclick' }, + getFileType: function() { + switch(this.model.contentType) { + case 'video/quicktime': return 'mov'; + default: return this.model.contentType.split('/')[1]; + } + }, onclick: function(e) { switch (this.contentType) { case 'image': @@ -105,8 +110,9 @@ if (this.timestamp) { suggestion += moment(this.timestamp).format('-YYYY-MM-DD-HHmmss'); } - if (this.fileType) { - suggestion += '.' + this.fileType; + var fileType = this.getFileType(); + if (fileType) { + suggestion += '.' + fileType; } return suggestion; },