diff options
author | Giovane <giovaneliberato@gmail.com> | 2015-12-29 15:52:39 -0200 |
---|---|---|
committer | Giovane <giovaneliberato@gmail.com> | 2015-12-29 15:52:39 -0200 |
commit | 5dca3fda432c12cd63ab4c8011aa2ea74ce1a771 (patch) | |
tree | b6bb52d9304b56ddeb1a99230963549746d3256b /web-ui/app | |
parent | 32e625a9389bc7352c911ebc5db289647db3ba66 (diff) |
Shows selected tag in addition of unread count #564
Diffstat (limited to 'web-ui/app')
-rw-r--r-- | web-ui/app/js/page/unread_count_title.js | 12 |
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 () { |