From 5dca3fda432c12cd63ab4c8011aa2ea74ce1a771 Mon Sep 17 00:00:00 2001 From: Giovane Date: Tue, 29 Dec 2015 15:52:39 -0200 Subject: Shows selected tag in addition of unread count #564 --- web-ui/app/js/page/unread_count_title.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'web-ui/app/js/page') diff --git a/web-ui/app/js/page/unread_count_title.js b/web-ui/app/js/page/unread_count_title.js index 26daabec..89dcd47d 100644 --- a/web-ui/app/js/page/unread_count_title.js +++ b/web-ui/app/js/page/unread_count_title.js @@ -35,11 +35,13 @@ define( return mail.status.indexOf('read') === -1; }).length; - if (unread > 0) { - document.title = '(' + unread + ') - ' + this.rawTitle; - } else { - document.title = this.rawTitle; - } + var tag = this.toTitleCase(data.tag); + var counter = unread > 0 ? ' (' + unread + ') - ' : ' - '; + document.title = tag + counter + this.rawTitle; + }; + + this.toTitleCase = function (str) { + return str.replace(/\b\w/g, function (txt) { return txt.toUpperCase(); }); }; this.after('initialize', function () { -- cgit v1.2.3