From f16debebbfc9d88fd84d4faf992eeba6ae9a2d29 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Sun, 6 Mar 2016 16:30:51 -0800 Subject: [PATCH] Handle empty subject lines in bootstrap --- CHANGELOG.md | 1 + themes/bootstrap/public/mailbox.js | 15 +++++++++++---- themes/bootstrap/templates/mailbox/index.html | 5 +++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a18bd8a..7b4ef28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Shutdown hang in retention scanner +- Display empty subject as `(No Subject)` ## [1.1.0-rc1] - 2016-03-04 ### Added diff --git a/themes/bootstrap/public/mailbox.js b/themes/bootstrap/public/mailbox.js index 2abf09a..3e3e762 100644 --- a/themes/bootstrap/public/mailbox.js +++ b/themes/bootstrap/public/mailbox.js @@ -107,10 +107,17 @@ function onDocumentReady() { // Prevent search and resize handlers being called too often var searchDelay = makeDelay(200); var resizeDelay = makeDelay(100); - $.addTemplateFormatter("DateFormatter", - function(value, template) { - return moment(value).calendar(); - }); + $.addTemplateFormatter({ + "date": function(value, template) { + return moment(value).calendar(); + }, + "subject": function(value, template) { + if (value == null || value.length == 0) { + return "(No Subject)"; + } + return value; + } + }); $("#message-list").hide(); onWindowResize(); $(window).resize(function() { diff --git a/themes/bootstrap/templates/mailbox/index.html b/themes/bootstrap/templates/mailbox/index.html index e5dbd45..6644fd4 100644 --- a/themes/bootstrap/templates/mailbox/index.html +++ b/themes/bootstrap/templates/mailbox/index.html @@ -15,9 +15,10 @@ $(document).ready(function() {