summaryrefslogtreecommitdiff
path: root/web-ui/app/js/page/unread_count_title.js
diff options
context:
space:
mode:
Diffstat (limited to 'web-ui/app/js/page/unread_count_title.js')
-rw-r--r--web-ui/app/js/page/unread_count_title.js12
1 files changed, 7 insertions, 5 deletions
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 () {