From 226e6751c6e4e0e08810da9e771ea41ab72c68d5 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 5 Feb 2017 20:52:24 +1300 Subject: [PATCH] client: separate NEW vs NEW-PM titles, move user count to the end of the title --- client/dcwebui.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client/dcwebui.js b/client/dcwebui.js index 30a9a5a..8d57042 100644 --- a/client/dcwebui.js +++ b/client/dcwebui.js @@ -765,10 +765,15 @@ var toggle_joinparts = function(ev) { /* */ var updateTitle = function() { - document.title = - ($(".unread").length ? "[NEW PM] " : "") + - "("+userlist.count()+") "+ - hub_hubname; + var prefix = ""; + var unrTabs = $(".unread"); + if (unrTabs.length === 1 && unrTabs[0].getAttribute('data-tab') == "tab-main") { + prefix = "[NEW] " + } else if (unrTabs.length > 0) { + prefix = "[NEW PM] " + } + + document.title = prefix + hub_hubname + "("+userlist.count()+") " }; var sock = {};